listEvents() public method

Lists all events in the time range, optionally restricting results to only events with alarms.
public listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] )
$startDate Horde_Date The start of range date.
$endDate Horde_Date The end of date range.
$options array Additional options: - show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range) - has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events) - json: (boolean) Store the results of the event's toJson() method? DEFAULT: false - cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true - hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events) - fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)
Ejemplo n.º 1
0
 /**
  * Lists all events in the time range, optionally restricting results to
  * only events with alarms.
  *
  * @param Horde_Date $startDate  The start of range date.
  * @param Horde_Date $endDate    The end of date range.
  * @param array $options         Additional options:
  *   - show_recurrence: (boolean) Return every instance of a recurring
  *                       event?
  *                      DEFAULT: false (Only return recurring events once
  *                      inside $startDate - $endDate range)
  *   - has_alarm:       (boolean) Only return events with alarms.
  *                      DEFAULT: false (Return all events)
  *   - json:            (boolean) Store the results of the event's toJson()
  *                      method?
  *                      DEFAULT: false
  *   - cover_dates:     (boolean) Add the events to all days that they
  *                      cover?
  *                      DEFAULT: true
  *   - hide_exceptions: (boolean) Hide events that represent exceptions to
  *                      a recurring event.
  *                      DEFAULT: false (Do not hide exception events)
  *   - fetch_tags:      (boolean) Fetch tags for all events.
  *                      DEFAULT: false (Do not fetch event tags)
  *
  * @throws Kronolith_Exception
  */
 public function listEvents(Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = array())
 {
     $json = !empty($options['json']);
     $options['json'] = false;
     $events = $this->_driver->listEvents($startDate, $endDate, $options);
     $results = array();
     foreach ($events as $period_key => $period) {
         foreach ($period as $event_id => $event) {
             $resource_event = $this->_buildResourceEvent($event);
             $results[$period_key][$event_id] = $json ? $resource_event->toJson() : $resource_event;
         }
     }
     return $results;
 }