class RegisterForm extends CFormModel
{
public $firstName;
public $lastName;
public $email;
public function rules()
{
return array(
array('firstName, lastName, email', 'required'),
array('email', 'email'),
array('email', 'checkEmail'),
);
}
public function attributeLabels()
{
return array();
}
public function checkEmail()
{
$record = Account::model()->findByAttributes(array('username'=>$this->email));
if ($record==null) {
return true;
}
return false;
}
}