• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/fields/relations/reference.php
  • Класс: BitrixMainORMFieldsRelationsReference
  • Вызов: Reference::validateValue
public function validateValue($value, $primary, $row, Result $result)
{
	$remoteObjectClass = $this->getRefEntity()->getObjectClass();

	if ($value !== null && !($value instanceof $remoteObjectClass))
	{
		$result->addError(new Error(sprintf(
			'Expected instance of `%s`, got `%s` instead', $remoteObjectClass, get_class($value)
		)));
	}

	return parent::validateValue($value, $primary, $row, $result);
}