booked/lib/Application/Schedule/ScheduleReservationList.php
/**
	 * @param ReservationListItem $item
	 * @return SchedulePeriod which has the closest starting time to $endingTime without going prior to it
	 */
@param ReservationListItem $item
@return SchedulePeriod which has the closest starting time to $endingTime without going prior to it
@param ReservationListItem $item @return SchedulePeriod which has the closest starting time to $endingTime without going prior to it
private function FindClosestLayoutIndexBeforeStartingTime(ReservationListItem $item)
	{
		for ($i = count($this->_layoutItems) - 1; $i >= 0; $i--)
		{
			$currentItem = $this->_layoutItems[$i];
			if ($currentItem->BeginDate()->LessThan($item->StartDate()))
			{
				return $currentItem;
			}
		}
		if ($item->StartDate()->LessThan($this->_layoutItems[0]->BeginDate()))
		{
			return $this->_layoutItems[0];
		}
		Log::Error('Could not find a fitting starting slot for reservation. Item %s', var_export($item, true));
		return null;
	}
private function FindClosestLayoutIndexBeforeStartingTime ( ReservationListItem $ item ) { for ( $ i = count ( $ this -> _layoutItems ) - 1 ; $ i >= 0 ; $ i -- ) { $ currentItem = $ this -> _layoutItems [ $ i ] ; if ( $ currentItem -> BeginDate ( ) -> LessThan ( $ item -> StartDate ( ) ) ) { return $ currentItem ; } } if ( $ item -> StartDate ( ) -> LessThan ( $ this -> _layoutItems [ 0 ] -> BeginDate ( ) ) ) { return $ this -> _layoutItems [ 0 ] ; } Log :: Error ( 'Could not find a fitting starting slot for reservation. Item %s' , var_export ( $ item , true ) ) ; return null ; }
@param ReservationListItem $item
 @return SchedulePeriod which has the closest starting time to $endingTime without going prior to it
@param ReservationListItem $item @return SchedulePeriod which has the closest starting time to $endingTime without going prior to it