<?php
/**
* 手机号验证类
*
* @Copyright(c) 2007-2009
* @Author: iOrange
* @Email: yzxh24@gmail.com
* @Version $id:file 2009-11-19 22:36:02
*/
/* vim: set ts=4 sw=4: */
class MobileValidator extends CValidator
{
	protected function validateAttribute($object, $attribute)
	{
		$value = $object->$attribute;
		if (strlen($value) > 11 || strlen($value) < 10)
		{
			$this->addError($object, $attribute,'手机号不合法');
			return ;
		}
		
		if($value < 1300000000 || $value > 19000000000)
		{
			$this->addError($object, $attribute, '手机号不合法');
		}
	}
}