Esempio n. 1
0
 public function isValid($value, array $context = \null)
 {
     if ($this->isRequired() && !isset($this->validators[Validate\NotIdentical::class])) {
         $this->prependValidator(new Validate\NotIdentical(['value' => $this->uncheckedValue, 'error' => 'Полето е задължително']));
     }
     return parent::isValid($value, $context);
 }
Esempio n. 2
0
 public function isValid($value, array $context = \null)
 {
     $valid = parent::isValid($value, $context);
     if ($this->isArray && empty($value)) {
         $this->setValue([]);
     }
     return $valid;
 }