method public

Reference::addValidator()

Класс: \Bitrix\Main\ORM\Fields\Relations\Reference

Сигнатура

public addValidator(Validator|callable $validator) : $this

Параметры

$validator Validator|callable

Возвращаемое значение

$this

Как применяется в Reference

Reference::addValidator() — метод класса \Bitrix\Main\ORM\Fields\Relations\Reference модуля «Главный модуль». Reference: Поле Reference описывает отношение 1-к-1 или 1-ко-многим между двумя сущностями.

Метод объекта: сначала нужен экземпляр Reference.

use Bitrix\Main\ORM\Fields\Relations\Reference;

/** @var Reference $object */
$validator = null; // Validator|callable
$result = $object->addValidator($validator);
// $result: $this

Другие методы Reference

addValidator() есть и у других классов модуля «Главный модуль»: ArrayField, BooleanField, CryptoField, DateField, DatetimeField, DecimalField, EnumField, ExpressionField.

Исходный файл: source/main/lib/orm/fields/relations/reference.php:275

Что будем искать? Например,Продвижение