Exemplo n.º 1
0
 private function nameUniqueValidator()
 {
     $uniqueValidator = new NoRecordExists(array('table' => 'user', 'field' => 'username', 'adapter' => $this->dbAdapter, 'messages' => array(\Zend\Validator\Db\NoRecordExists::ERROR_RECORD_FOUND => 'user with this username already exists')));
     $select = new Select();
     $select->from('user');
     $select->where(array('username= ?' => $this->data->username));
     $uniqueValidator->setSelect($select);
     return $uniqueValidator;
 }