Example #1
0
 /**
  * @return boolean
  */
 public function validate()
 {
     if (!parent::validate()) {
         return false;
     }
     return true;
 }
Example #2
0
 /**
  * @return boolean
  */
 public function validate()
 {
     if (!parent::validate()) {
         return false;
     }
     if (!$this->primaryKeyValue) {
         $oQuery = $this->db->select()->from('client', 'id')->where('title = ?', $this->controls['title']->getValue())->where('deleted != ?', 'yes');
         if ($this->db->fetchOne($oQuery)) {
             $this->errors[] = $this->actionController->localizer->translate('Client with such name already exists');
             return false;
         }
     }
     return true;
 }
Example #3
0
 /**
  * @return boolean
  */
 public function validate()
 {
     if (!parent::validate()) {
         return false;
     }
     // Check is login uniq
     if (!$this->primaryKeyValue) {
         $oQuery = $this->db->select()->from('user', 'id')->where('login = ?', trim($this->controls['login']->getValue()))->where('deleted != ?', 'yes');
         if ($this->db->fetchOne($oQuery)) {
             $this->errors[] = $this->localizer->translate('User with such login already exists');
             return false;
         }
     }
     // Check password confirm
     if ($this->controls['password']->getValue() != $this->controls['repeat_password']->getValue()) {
         $this->errors[] = $this->localizer->translate('Passwords does not match');
         return false;
     }
     return true;
 }