• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/Command/Command.php
  • Класс: BitrixImV2EntityCommandCommand
  • Вызов: Command::prepareData
protected function prepareData(array $commandList): array
{
	$this->loadRestLang = false;
	$result = [];

	foreach ($commandList as $command)
	{
		$command['COMMAND_ID'] = $command['ID'];
		$command['CONTEXT'] = '';

		if ($command['BOT_ID'] > 0)
		{
			$command['CATEGORY'] = BitrixImUser::getInstance($command['BOT_ID'])->getFullName();
		}
		else if ($command['MODULE_ID'] == 'im')
		{
			$command['CATEGORY'] = Loc::getMessage('COMMAND_IM_CATEGORY');
		}
		else
		{
			$module = (new CModule())->createModuleObject($command['MODULE_ID']);
			$command['CATEGORY'] = $module->MODULE_NAME;
		}

		if (!empty($command['CLASS']) && !empty($command['METHOD_LANG_GET']))
		{
			$command = $this->setModuleParams($command, $this->lang);
		}
		else
		{
			$command = $this->setModuleRestParams($command);
		}

		$result[(int)$command['ID']] = $command;
	}

	if ($this->loadRestLang)
	{
		$result = $this->commandRestLang($result);
	}

	$this->sortCommandData($result);

	return $result;
}