- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/entity/validator/range.php
- Класс: BitrixMainEntityValidatorRange
- Вызов: Range::validate
public function validate($value, $primary, array $row, EntityField $field)
{
if ($this->min !== null)
{
if ((!$this->equality && $value < $this->min) || ($this->equality && $value <= $this->min))
{
$mess = ($this->errorPhraseMin !== null? $this->errorPhraseMin : Loc::getMessage($this->errorPhraseMinCode));
return $this->getErrorMessage($value, $field, $mess, array("#MIN#" => $this->min));
}
}
if ($this->max !== null)
{
if ((!$this->equality && $value > $this->max) || ($this->equality && $value >= $this->max))
{
$mess = ($this->errorPhraseMax !== null? $this->errorPhraseMax : Loc::getMessage($this->errorPhraseMaxCode));
return $this->getErrorMessage($value, $field, $mess, array("#MAX#" => $this->max));
}
}
return true;
}