Exemplo n.º 1
0
 public function validate($save_method)
 {
     Pfw_Loader::loadClass('Pfw_Validate');
     $pfv = new Pfw_Validate($this);
     if (Pfw_Model::SAVE_INSERT == $save_method) {
         $pfv->presence('name', "required!");
         $pfv->presence('description', "required!");
     }
     return $pfv->success();
 }
Exemplo n.º 2
0
 public function validate($save_method)
 {
     Pfw_Loader::loadClass('Pfw_Validate');
     $pfv = new Pfw_Validate($this);
     if (Pfw_Model::SAVE_INSERT == $save_method) {
         $pfv->presence('first_name', "required!");
         $pfv->presence('last_name', "required!");
         $pfv->presence('email', "required!");
         $pfv->email('email', "Email is invalid!");
         $pfv->presence('password', "required!");
         if ($pfv->presence('email', "required!")) {
             $email_user = User::Q()->getByEmail($this->email)->exec();
             if (!empty($email_user)) {
                 $this->addError('email', "email is taken");
                 $pfv->fail();
             }
         }
     }
     return $pfv->success();
 }
Exemplo n.º 3
0
 public function emailValidate($save_method)
 {
     Pfw_Loader::loadClass('Pfw_Validate');
     $v = new Pfw_Validate($this);
     $v->email('email');
     return $v->success();
 }