• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/util/scheduler.php
  • Класс: BitrixTasksUtilScheduler
  • Вызов: Scheduler::__construct
public function __construct($userId, $task, array $taskData = array(), Calendar $calendar = null)
{
	if($calendar === null)
	{
		$this->calendar = new Calendar();
	}
	else
	{
		$this->calendar = $calendar;
	}

	$this->userId = Assert::expectIntegerPositive($userId, '$userId', 'Incorrect userId passed');

	if(is_object($task) && $task instanceof CTaskItem)
	{
		$this->taskId = $task->getId();
		$this->initializeTaskFromObject($task);
	}
	else
	{
		$this->taskId = intval($task);

		if(!$this->taskId && empty($taskData))
		{
			throw new ArgumentException('Neither correct task id nor task data specified');
		}

		$this->initializeTaskFromData($taskData);
	}
}