shiftFits($shift)) { $this->shifts[] = $shift; return; } throw new Exception('Unable to add shift to shift calendar lane.'); } /** * Returns true if given shift fits into this lane. * * @param array $newShift * @return bool * @internal param array $shift The shift to fit into this lane */ public function shiftFits($newShift) { foreach ($this->shifts as $laneShift) { if (!($newShift['start'] >= $laneShift['end'] || $newShift['end'] <= $laneShift['start'])) { return false; } } return true; } /** * @return string */ public function getHeader() { return $this->header; } /** * @return array[] */ public function getShifts() { return $this->shifts; } }