• Модуль: messageservice
  • Путь к файлу: ~/bitrix/modules/messageservice/lib/restservice.php
  • Класс: BitrixMessageServiceRestService
  • Вызов: RestService::getAppNames
static function getAppNames($clientId)
{
	$iterator = BitrixRestAppTable::getList(
		[
			'filter' => [
				'=CLIENT_ID' => $clientId
			],
			'select' => ['ID', 'APP_NAME', 'CODE'],
		]
	);
	$app = $iterator->fetch();
	$result = [
		'**' => $app['APP_NAME'] ? $app['APP_NAME'] : $app['CODE']
	];

	$orm = BitrixRestAppLangTable::getList([
		'filter' => [
			'=APP_ID' => $app['ID']
		],
		'select' => ['LANGUAGE_ID', 'MENU_NAME']
	]);

	while ($row = $orm->fetch())
	{
		$result[mb_strtolower($row['LANGUAGE_ID'])] = $row['MENU_NAME'];
	}

	if (isset($result[LANGUAGE_ID]))
	{
		$result['**'] = $result[LANGUAGE_ID];
	}

	return $result;
}