Item::getFieldSettings

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Item
  4. getFieldSettings
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/bizproc/document/item.php
  • Класс: Bitrix\Crm\Integration\BizProc\Document\Item
  • Вызов: Item::getFieldSettings
static function getFieldSettings(array $field, Crm\Service\Factory $factory): ?array
{
	if (array_key_exists('CLASS', $field))
	{
		switch ($field['CLASS'])
		{
			case Crm\Field\Stage::class:
				$settings = ['Groups' => []];
				foreach (static::getCategories($factory) as $category)
				{
					$stages = [];
					foreach (static::getStages($factory, $category) as $stage)
					{
						$stages[$stage['STATUS_ID']] = $stage['NAME'];
					}

					$settings['Groups'][] = [
						'name' => $category->getName(),
						'category_id' => $category->getId(),
						'items' => $stages,
					];
				}

				return $settings;
		}
	}

	return null;
}

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