booked/WebServices/SchedulesWebService.php
/**
	 * @name GetSlots
	 * @description Loads slots for a specific schedule
	 * Optional query string parameters:  resourceId, startDateTime, endDateTime.
	 * If no dates are provided the default schedule dates will be returned.
	 * If dates do not include the timezone offset, the timezone of the authenticated user will be assumed.
	 * @response ScheduleSlotsResponse
	 * @param $scheduleId
	 * @return void
	 */
@name GetSlots
@description Loads slots for a specific schedule
Optional query string parameters:  resourceId, startDateTime, endDateTime.
If no dates are provided the default schedule dates will be returned.
If dates do not include the timezone offset, the timezone of the authenticated user will be assumed.
@response ScheduleSlotsResponse
@param $scheduleId
@return void
@name GetSlots @description Loads slots for a specific schedule Optional query string parameters : resourceId startDateTime endDateTime . If no dates are provided the default schedule dates will be returned . If dates do not include the timezone offset the timezone of the authenticated user will be assumed . @response ScheduleSlotsResponse @param $scheduleId @return void
public function GetSlots($scheduleId)
	{
		$startDate = $this->GetDate(WebServiceQueryStringKeys::START_DATE_TIME);
		$endDate = $this->GetDate(WebServiceQueryStringKeys::END_DATE_TIME);
        $resourceId = $this->server->GetQueryString(WebServiceQueryStringKeys::RESOURCE_ID);
		$scheduleWebServiceView = new ScheduleWebServiceView($scheduleId, $startDate, $resourceId);
		$permissionServiceFactory = new PermissionServiceFactory();
		$scheduleRepository = new ScheduleRepository();
		$userRepository = new UserRepository();
		$resourceService = new ResourceService(new ResourceRepository(), $permissionServiceFactory->GetPermissionService(), new AttributeService(new AttributeRepository()), $userRepository, new AccessoryRepository());
		$builder = new ScheduleWebServicePageBuilder($startDate, $endDate, $resourceId);
		$reservationService = new ReservationService(new ReservationViewRepository(), new ReservationListingFactory());
		$dailyLayoutFactory = new DailyLayoutFactory();
		$scheduleService = new ScheduleService($scheduleRepository, $resourceService, new DailyLayoutFactory());
		$presenter = new SchedulePresenter($scheduleWebServiceView, $scheduleService, $resourceService, $builder, $reservationService, $dailyLayoutFactory);
		$presenter->PageLoad($this->server->GetSession());
		$layout = $scheduleWebServiceView->GetDailyLayout();
		$isError = $scheduleWebServiceView->IsPermissionError();
		$dates = $scheduleWebServiceView->GetDates();
		$resources = $scheduleWebServiceView->GetResources();
		if ($isError)
		{
			$this->server->WriteResponse(RestResponse::Unauthorized(), RestResponse::UNAUTHORIZED_CODE);
		}
		else
		{
			$response = new ScheduleSlotsResponse($this->server, $scheduleId, $layout, $dates, $resources, $this->privacyFilter);
			$this->server->WriteResponse($response);
		}
	}
public function GetSlots ( $ scheduleId ) { $ startDate = $ this -> GetDate ( WebServiceQueryStringKeys :: START_DATE_TIME ) ; $ endDate = $ this -> GetDate ( WebServiceQueryStringKeys :: END_DATE_TIME ) ; $ resourceId = $ this -> server -> GetQueryString ( WebServiceQueryStringKeys :: RESOURCE_ID ) ; $ scheduleWebServiceView = new ScheduleWebServiceView ( $ scheduleId , $ startDate , $ resourceId ) ; $ permissionServiceFactory = new PermissionServiceFactory ( ) ; $ scheduleRepository = new ScheduleRepository ( ) ; $ userRepository = new UserRepository ( ) ; $ resourceService = new ResourceService ( new ResourceRepository ( ) , $ permissionServiceFactory -> GetPermissionService ( ) , new AttributeService ( new AttributeRepository ( ) ) , $ userRepository , new AccessoryRepository ( ) ) ; $ builder = new ScheduleWebServicePageBuilder ( $ startDate , $ endDate , $ resourceId ) ; $ reservationService = new ReservationService ( new ReservationViewRepository ( ) , new ReservationListingFactory ( ) ) ; $ dailyLayoutFactory = new DailyLayoutFactory ( ) ; $ scheduleService = new ScheduleService ( $ scheduleRepository , $ resourceService , new DailyLayoutFactory ( ) ) ; $ presenter = new SchedulePresenter ( $ scheduleWebServiceView , $ scheduleService , $ resourceService , $ builder , $ reservationService , $ dailyLayoutFactory ) ; $ presenter -> PageLoad ( $ this -> server -> GetSession ( ) ) ; $ layout = $ scheduleWebServiceView -> GetDailyLayout ( ) ; $ isError = $ scheduleWebServiceView -> IsPermissionError ( ) ; $ dates = $ scheduleWebServiceView -> GetDates ( ) ; $ resources = $ scheduleWebServiceView -> GetResources ( ) ; if ( $ isError ) { $ this -> server -> WriteResponse ( RestResponse :: Unauthorized ( ) , RestResponse :: UNAUTHORIZED_CODE ) ; } else { $ response = new ScheduleSlotsResponse ( $ this -> server , $ scheduleId , $ layout , $ dates , $ resources , $ this -> privacyFilter ) ; $ this -> server -> WriteResponse ( $ response ) ; } }
@name GetSlots
 @description Loads slots for a specific schedule
 Optional query string parameters:  resourceId, startDateTime, endDateTime.
@name GetSlots @description Loads slots for a specific schedule Optional query string parameters : resourceId startDateTime endDateTime .