Метод assertTemplateSourcesOwned
Сигнатура метода
public static function assertTemplateSourcesOwned(array $definition, ?int $ownerTemplateId): void
Возвращает:
void
Описание
A template constant or variable belongs to the template that declares it, so a definition may reference it only while it is written for that very template. The owner is known outside the definition (on save it is the owner of the view, on preview the template being edited), hence the rule is exposed on its own and every entry point that accepts a definition from outside ({@see \Bitrix\Bizproc\Public\Command\DataView\SaveDataViewCommandHandler}, {@see \Bitrix\Bizproc\Public\DataView\Service\PreviewService}) calls it with the owner it holds. Validation through {@see DataViewValidator} carries no owner and therefore must not apply it: a null owner here means "no template source is allowed", not "any owner will do". A definition without template-scoped sources is owner-agnostic and stays valid with any owner, including none.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$definition
|
array
|
—
|
—
|
$ownerTemplateId
|
?int
|
—
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesbizproc/lib/Internal/Service/DataView/ColumnResolver.php