Exemple #1
0
 public function __construct($options, $name = null, $min = 1, $max = 50)
 {
     parent::__construct($name, $min, $max);
     $this->dbNoRecordExistsValidator = new NoRecordExists($options);
     $this->getValidatorChain()->attach($this->dbNoRecordExistsValidator);
     $messageTemplates = [NoRecordExists::ERROR_RECORD_FOUND => "Перевод для указанного ключа уже существует"];
     $this->dbNoRecordExistsValidator->setMessages($messageTemplates);
     $this->getFilterChain()->attachByName('StringTrim');
 }