• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/update/taskchecklistconverter.php
  • Класс: BitrixTasksUpdateTaskCheckListConverter
  • Вызов: TaskCheckListConverter::getParams
static function getParams()
{
	$connection = Application::getConnection();

	$params = Option::get("tasks", static::$paramsOptionName);
	$params = ($params !== ""? unserialize($params, ['allowed_classes' => false]) : []);
	$params = (is_array($params)? $params : []);

	if (empty($params))
	{
		$entityIdName = static::$entityIdName;
		$entityItemsTableName = static::$entityItemsTableName;

		$entitiesCount = $connection->query("
			SELECT COUNT(CNT.{$entityIdName}) AS CNT
			FROM (
				SELECT {$entityIdName}
				FROM {$entityItemsTableName}
				WHERE TITLE = '==='
				GROUP BY {$entityIdName}
			) CNT
		")->fetch()['CNT'];

		$params = [
			"number" => 0,
			"count" => (int)$entitiesCount,
		];
	}

	return $params;
}