@ -2,6 +2,8 @@
namespace Engelsystem;
use Exception;
/**
* Represents a single lane in a shifts calendar.
*/
@ -38,6 +40,7 @@ class ShiftCalendarLane
* Returns true on success.
*
* @param array $shift The shift to add
* @throws Exception if the shift doesn't fit into the lane.
public function addShift($shift)
{
@ -1,6 +1,8 @@
<?php
class ShiftCalendarRenderer
@ -93,9 +95,9 @@ class ShiftCalendarRenderer
$shift_added = false;
foreach ($lanes[$room_id] as $lane) {
/** @var ShiftCalendarLane $lane */
try {
if($lane->shiftFits($shift)) {
$lane->addShift($shift);
} catch (Exception $e) {
$shift_added = true;
break;
}