• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/repo.php
  • Класс: BitrixLandingRepo
  • Вызов: Repo::getAppByCode
static function getAppByCode($code)
{
	$apps = array();

	if ($code && BitrixMainLoader::includeModule('rest'))
	{
		$res = AppTable::getList(array(
			'filter' => array(
				'=CODE' => $code
			)
		));
		while ($row = $res->fetch())
		{
			$row['APP_STATUS'] = AppTable::getAppStatusInfo($row, '');
			$apps[$row['CODE']] = array(
				'CODE' => $row['CODE'],
				'APP_NAME' => $row['APP_NAME'],
				'VERSION' => $row['VERSION'],
				'DATE_FINISH' => $row['DATE_FINISH'],
				'PAYMENT_ALLOW' => $row['APP_STATUS']['PAYMENT_ALLOW']
			);
		}
	}

	if ($apps)
	{
		return is_array($code) ? $apps : array_pop($apps);
	}

	return $apps;
}