function ErrorParams() { if ($this->error) { return array($this->compareValue); } return parent::ErrorParams(); }
/** * Returns the folder name for the message * @return array */ protected function ErrorParams() { if ($this->error == self::ExistsInFolder) { return array($this->folder); } return parent::ErrorParams(); }
/** * Creates a new length validator * @param int $minLength * @param int $maxLength * @param bool $trimValue * @param string errorLabelPrefix; */ function __construct($minLength, $maxLength, $trimValue = true, $errorLabelPrefix = '') { if ($maxLength >= 0 && $maxLength < $minLength) { throw new \InvalidArgumentException('max length must be greater than or equal min length'); } $this->maxLength = $maxLength; $this->minLength = $minLength; parent::__construct($errorLabelPrefix, $trimValue); }
/** * * @param type $fieldName * @param type $checkUploadError * @param type $required * @param int $maxSize max size in bytes * @param array $mimeTypes * @param string $errorLabelPrefix */ function __construct($fieldName, $checkUploadError = true, $required = true, $maxSize = 0, array $mimeTypes = array(), $errorLabelPrefix = '') { $this->upload = new IO\Upload($fieldName); $this->maxSize = $maxSize; $this->required = $required; $this->checkUploadError = $checkUploadError; $this->mimeTypes = $mimeTypes; parent::__construct($errorLabelPrefix); }
function ErrorParams() { switch ($this->error) { case self::ParseFailed: return array($this->format); case self::TooEarly: return array($this->minDate->ToString($this->format)); case self::TooLate: return array($this->maxDate->ToString($this->format)); } return parent::ErrorParams(); }
/** * * @param Sql\Select $select * @param int $minCount * @param int $maxCount * @param string $errorLabelPrefix */ function __construct(Sql\Select $prepared, $minCount = 1, $maxCount = 1, $errorLabelPrefix = '') { $this->prepared = $prepared; $this->minCount = (int) $minCount; $this->maxCount = (int) $maxCount; parent::__construct($errorLabelPrefix); }
/** * Adds a validator to the name * @param string $name * @param Validator $validator * @param string $errorPrefix A custom error prefix */ protected function AddValidator($name, Validator $validator, $errorPrefix = '') { $field = $this->GetElement($name); if (!$errorPrefix) { $errorPrefix = $this->ErrorPrefix($name); } $validator->SetErrorLabelPrefix($errorPrefix); $field->AddValidator($validator); }
/** * * @param string $errorLabelPrefix The error label prefix * @param string $trimValue */ function __construct($errorLabelPrefix = '', $trimValue = true) { parent::__construct($errorLabelPrefix, $trimValue); }
function __construct(AccessBase\Guard $guard, $verifyOnly = false, $errorLabelPrefix = '') { $this->guard = $guard; $this->verifyOnly = $verifyOnly; parent::__construct($errorLabelPrefix); }
function ErrorParams() { if ($this->error == self::ExceedsMax) { return array($this->max); } else { if ($this->error == self::ExceedsMin) { return array($this->min); } } return parent::ErrorParams(); }