src/Jaspersoft/Service/JobService.php
public function getCalendar($calendarName)
    {
        // rawurlencode will convert spaces to %20 as required by server
        $url = $this->service_url . '/jobs/calendars/' . rawurlencode($calendarName);
        $response = $this->service->prepAndSend($url, array(200), 'GET', null, true);
        $calendarData = json_decode($response);
        if (empty($calendarData->calendarType)) {
            throw new RESTRequestException("JobService: Data format not expected.");
        }
        $className = JobService::CALENDAR_NAMESPACE . '\\'. ucfirst($calendarData->calendarType) . "Calendar";

        if (class_exists($className)) {
            return $className::createFromJSON($calendarData);
        } else {
            throw new RESTRequestException("JobService: Unrecognized calendar type returned by server");
        }
    }
public function getCalendar($calendarName)
    {
        // rawurlencode will convert spaces to %20 as required by server
        $url = $this->service_url . '/jobs/calendars/' . rawurlencode($calendarName);
        $response = $this->service->prepAndSend($url, array(200), 'GET', null, true);
        $calendarData = json_decode($response);
        if (empty($calendarData->calendarType)) {
            throw new RESTRequestException("JobService: Data format not expected.");
        }
        $className = JobService::CALENDAR_NAMESPACE . '\\'. ucfirst($calendarData->calendarType) . "Calendar";

        if (class_exists($className)) {
            return $className::createFromJSON($calendarData);
        } else {
            throw new RESTRequestException("JobService: Unrecognized calendar type returned by server");
        }
    }
public function getCalendar ( $ calendarName ) { // rawurlencode will convert spaces to %20 as required by server $ url = $ this -> service_url . '/jobs/calendars/' . rawurlencode ( $ calendarName ) ; $ response = $ this -> service -> prepAndSend ( $ url , array ( 200 ) , 'GET' , null , true ) ; $ calendarData = json_decode ( $ response ) ; if ( empty ( $ calendarData -> calendarType ) ) { throw new RESTRequestException ( "JobService: Data format not expected." ) ; } $ className = JobService :: CALENDAR_NAMESPACE . '\\' . ucfirst ( $ calendarData -> calendarType ) . "Calendar" ; if ( class_exists ( $ className ) ) { return $ className :: createFromJSON ( $ calendarData ) ; } else { throw new RESTRequestException ( "JobService: Unrecognized calendar type returned by server" ) ; } }
Retrieve a calendar and its properties

@param string $calendarName Name of the calendar to obtain details of
@return BaseCalendar
@throws \Jaspersoft\Exception\RESTRequestException
Retrieve a calendar and its properties