• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/action/shiftsmanager.php
  • Класс: BitrixTimemanServiceWorktimeActionShiftsManager
  • Вызов: ShiftsManager::buildShiftWithDates
public function buildShiftWithDates(DateTime $from, DateTime $to)
{
	$workingShifts = [];
	$periodIterator = TimeHelper::getInstance()->buildDatesIterator($from, $to);
	foreach ($periodIterator as $date)
	{
		foreach ($this->activeSchedules as $schedule)
		{
			foreach ($this->getShiftsByDate($schedule, $date) as $shift)
			{
				$shiftWithDate = new ShiftWithDate($shift, $schedule, $date);

				if ($schedule->isShifted() && !$this->hasShiftPlan($shiftWithDate))
				{
					continue;
				}
				$workingShifts[] = $shiftWithDate;
			}
		}
	}
	return $workingShifts;
}