State::get

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. State
  4. get
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/volatile/type/state.php
  • Класс: Bitrix\Crm\Integrity\Volatile\Type\State
  • Вызов: State::get
public function get(int $volatileTypeId): Result
{
	$result = new Result();

	$localResult = $this->bulkGet([$volatileTypeId]);

	if ($localResult->isSuccess())
	{
		$stateMap = $localResult->getData();
		if (isset($stateMap[$volatileTypeId]))
		{
			$stateId = $stateMap[$volatileTypeId];
		}
		else
		{
			$stateId = State::STATE_UNDEFINED;
		}
		$result->setData(['stateId' => $stateId]);
	}
	else
	{
		$result->addErrors($localResult->getErrors());
	}

	return $result;
}

Добавить комментарий