Метод add

public

Сигнатура метода

public function add(DictionaryType $type, array $fields, int $userId, Scope $scope = Scope::Manual): Result

Возвращает: Result

Описание

Creates a value of the dictionary $type out of $fields as $userId, and answers with the created value read back from storage. `name` is required and `id` and `sort` are not: an identifier left out - or given as an empty string - is generated, and a position left out is the one the storage layer gives a new value. The caller learns both from the value handed back. An identifier of blanks alone asks for neither and is refused, and so is `'0'`, which the storage layer would read as an identifier it was not given. $scope names where the write came from and is read nowhere - see the note of the class about it.

Параметры

4
Имя Тип По умолчанию Флаги
$type DictionaryType —
—
$fields array —
—
$userId int —
—
$scope Scope Scope::Manual
—

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/V2/Internal/Service/Dictionary/DictionaryValueService.php
Расположение метода в файле
Строки 161–186

Исходный код

PHP