• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/publicaction/block.php
  • Класс: BitrixLandingPublicActionBlock
  • Вызов: Block::getById
static function getById($block, array $params = array())
{
	$error = new BitrixLandingError;
	$result = new PublicActionResult();
	$block = (int)$block;

	// recognize landing by block
	$lid = BlockCore::getLandingIdByBlockId($block);
	if ($lid)
	{
		// and find this block in landing blocks
		$blocks = self::getList($lid, $params)->getResult();
		foreach ($blocks as $item)
		{
			if ($item['id'] == $block)
			{
				$result->setResult($item);
				return $result;
			}
		}
	}

	$error->addError(
		'BLOCK_NOT_FOUND',
		Loc::getMessage('LANDING_BLOCK_NOT_FOUND')
	);
	$result->setError($error);

	return $result;
}