• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/config.php
  • Класс: BitrixImOpenLinesConfig
  • Вызов: Config::createPreset
public function createPreset(): bool
{
	$anyActiveLine = ConfigTable::getRow([
		'select' => ['ID'],
		'filter' => ['=ACTIVE' => 'Y'],
	]);
	if (!$anyActiveLine)
	{
		if (!$this->userId)
		{
			$users = SecurityHelper::getAdministrators();
			$this->userId = reset($users);
		}

		$lineId = $this->create([
			'QUEUE' => [
				$this->userId
			]
		]);
		if (!$lineId)
		{
			return false;
		}
	}

	return true;
}