• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/fields/validators/validator.php
  • Класс: BitrixMainORMFieldsValidatorsValidator
  • Вызов: Validator::getErrorMessage
protected function getErrorMessage($value, ORMFieldsField $field, $errorPhrase = null, $additionalTemplates = null)
{
	if ($errorPhrase === null)
	{
		$errorPhrase = ($this->errorPhrase !== null? $this->errorPhrase : Loc::getMessage($this->errorPhraseCode));
	}

	$langValues = array(
		'#VALUE#' => $value,
		'#FIELD_NAME#' => $field->getName(),
		'#FIELD_TITLE#' => $field->getTitle()
	);
	if (is_array($additionalTemplates))
	{
		$langValues += $additionalTemplates;
	}

	return str_replace(
		array_keys($langValues),
		array_values($langValues),
		$errorPhrase
	);
}