...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integrity/volatile/type/state.php
- Класс: Bitrix\Crm\Integrity\Volatile\Type\State
- Вызов: State::bulkSet
public function bulkSet(array $volatileTypeStateMap): Result { $result = new Result(); if (empty($volatileTypeStateMap)) { $result->addError($this->makeErrorByCode(static::ERR_VOL_TYPE_STATE_MAP_EMPTY)); return $result; } $volatileTypeStateMap = $this->validateVolatileTypeStateMap($volatileTypeStateMap); if (empty($volatileTypeStateMap)) { $result->addError($this->makeErrorByCode(static::ERR_VOL_TYPE_STATE_MAP_INVALID)); return $result; } $localResult = $this->bulkGet(array_keys($volatileTypeStateMap)); if (!$localResult->isSuccess()) { $result->addErrors($localResult->getErrors()); return $result; } $currentVolatileTypeStateMap = $localResult->getData(); foreach ($volatileTypeStateMap as $volatileTypeId => $nextStateId) { $currentStateId = $currentVolatileTypeStateMap[$volatileTypeId] ?? static::STATE_UNDEFINED; $localResult = $this->set($volatileTypeId, $nextStateId, $currentStateId); if (!$localResult->isSuccess()) { $result->addErrors($localResult->getErrors()); } } return $result; }