• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/config.php
  • Класс: BitrixImOpenLinesConfig
  • Вызов: Config::checkLinesLimit
static function checkLinesLimit()
{
	$maxLines = Limit::getLinesLimit();
	if ($maxLines == 0)
	{
		return true;
	}
	if ($maxLines >= ModelConfigTable::getCount(array('=ACTIVE' => 'Y', '=TEMPORARY' => 'N')))
	{
		return true;
	}
	$orm = ModelConfigTable::getList(Array(
		'select' => Array('ID'),
		'filter' => Array(
			'=ACTIVE' => 'Y',
			'=TEMPORARY' => 'N'
		),
		'order' => Array(
			'ID' => 'ASC'
		)
	));

	$configManager = new self();
	while($row = $orm->fetch())
	{
		if ($maxLines != 0)
		{
			$maxLines--;
			continue;
		}
		$configManager->setActive($row['ID'], false);
	}

	return true;
}