Метод setActive
Сигнатура метода
public function setActive(int $formId, bool $isActive, int $userId): Result
Возвращает:
Result
Описание
Turns an existing CRM form on or off, answering with the version it carries after the write. The version moves exactly once. It is reserved the way every write of this class reserves it, and the update of the row then assigns the column to itself, because the update event of the table fills the version in whenever the column is absent from the write ({@see FormTable::onBeforeUpdate()}): leaving it out would move the version a second time and the caller would be answered a value the row no longer carries. The answer is read back from the row for the same reason - the reserved value is decided by the database and not here. The author of the change travels only when the form is turned on. Turning it off, the event of the table takes the column out of the write, so this operation promises no author there. The expected version is not taken: turning a form on and off is an operation over the state the caller has just read, not a change of the configuration competing with another one.
Параметры
3| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$formId
|
int
|
—
|
—
|
$isActive
|
bool
|
—
|
—
|
$userId
|
int
|
—
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulescrm/lib/V2/Internal/Repository/WebForm/FormWriteRepository.php