• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/classes/general/lists.php
  • Класс: CLists
  • Вызов: CLists::getNumberOfElements
static function getNumberOfElements($iblockId)
{
	$iblockId = intval($iblockId);
	if(!$iblockId)
	{
		throw new ArgumentException(Loc::getMessage("LISTS_REQUIRED_PARAMETER",array("#parameter#" => "iblockId")));
	}

	$connection = Application::getInstance()->getConnection();
	$sqlString = "SELECT COUNT(ID) as COUNT FROM b_iblock_element WHERE IBLOCK_ID=".$iblockId;
	$queryObject = $connection->query($sqlString);
	$result = $queryObject->fetch();

	return intval($result["COUNT"]);
}