public function validate($value) { parent::validate($value); if (!is_float($value)) { throw new \InvalidArgumentException("Field '{$this->name}' must be float/decimal"); } }
public function validate($value) { parent::validate($value); if (!is_string($value)) { throw new \InvalidArgumentException("Field '{$this->name}' must be string"); } }
public function validate($value) { parent::validate($value); if (!preg_match(static::REGEX, $value)) { throw new \InvalidArgumentException("Field '{$this->name}' must be in valid date-time format"); } }
public function validate($value) { parent::validate($value); if (!$value instanceof \DateTime) { throw new \InvalidArgumentException("Field '{$this->name}' must be instanceof \\DateTime"); } }
public function validate($value) { parent::validate($value); if (!is_string($value)) { throw new \InvalidArgumentException("Field '{$this->name}' must be string"); } if (strlen($value) > $this->getOption('max_length')) { throw new \InvalidArgumentException("Field '{$this->name}' value length > {$this->max_length}"); } }
public function __construct(array $options = []) { $this->_options['getter'] = null; parent::__construct($options); }