• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/schedule/scheduleservice.php
  • Класс: BitrixTimemanServiceScheduleScheduleService
  • Вызов: ScheduleService::updateShifts
private function updateShifts(Schedule $schedule, ScheduleForm $scheduleForm)
{
	$result = new Result();
	$changedEndShifts = new ShiftCollection();
	foreach ($scheduleForm->getShiftForms() as $shiftForm)
	{
		if ($shift = $schedule->obtainShiftByPrimary($shiftForm->shiftId))
		{
			$oldValue = $shift->getWorkTimeEnd();
			$this->safeRun($this->shiftService->update($shift, $shiftForm));
			$newValue = $shift->getWorkTimeEnd();
			if ($oldValue !== $newValue)
			{
				$changedEndShifts->add($shift);
			}
		}
	}
	$result->setData([$changedEndShifts]);
	return $result;
}