Possible properties are:
- t: title
- d: description
- c: calendar id
- s: start date
- e: end date
- fi: first day of a multi-day event
- la: last day of a multi-day event
- x: status (Kronolith::STATUS_* constant)
- al: all-day?
- bg: background color
- fg: foreground color
- pe: edit permissions?
- pd: delete permissions?
- vl: variable, i.e. editable length?
- a: alarm text or minutes
- r: recurrence type (Horde_Date_Recurrence::RECUR_* constant)
- bid: The baseid for an event representing an exception
- eod: The original date that an exception is replacing
- ic: icon
- ln: link
- aj: ajax link
- id: event id
- ty: calendar type (driver)
- l: location
- u: url
- sd: formatted start date
- st: formatted start time
- ed: formatted end date
- et: formatted end time
- at: attendees
- rs: resources
- tg: tag list
- mt: meeting (Boolean true if event has attendees, false otherwise).
- cb: created by (string describing when and who created the event).
- mb: modified by (string describing when and who last modified event).
- o: organizer (if known)
- oy: organizer you
- cr: creator's attendance response
- fs: Array of attached files.
public toJson ( array $options = [] ) : stdClass | ||
$options | array | An array of options: - all_day: (boolean) If not null, overrides whether the event is an all-day event. DEFAULT: null (Do not override). - full: (boolean) Whether to return all event details. DEFAULT: false (Do not return all details). - time_format: (string) The date() format to use for time formatting. DEFAULT: 'H:i' - history: (boolean) If true, ensures that this event's history is loaded from the History backend. DEFAULT: false (Do not ensure history is loaded). |
return | stdClass | A simple object. |
/** * Returns a simple object suitable for json transport representing this * event. * * @param boolean $allDay If not null, overrides whether the event is * an all-day event. * @param boolean $full Whether to return all event details. * @param string $time_format The date() format to use for time formatting. * * @return object A simple object. */ public function toJson($allDay = null, $full = false, $time_format = 'H:i') { $json = parent::toJson($allDay, $full, $time_format); if ($this->_ajaxLink) { $json->aj = $this->_ajaxLink; } elseif ($link = (string) $this->getViewUrl(array(), true, false)) { $json->ln = $link; } if (isset($this->_variableLength)) { $json->vl = $this->_variableLength; } return $json; }
/** * Returns a simple object suitable for json transport representing this * event. * * @param array $options An array of options: * * - all_day: (boolean) If not null, overrides whether the event is an * all-day event. * DEFAULT: null (Do not override). * - full: (boolean) Whether to return all event details. * DEFAULT: false (Do not return all details). * - time_format: (string) The date() format to use for time formatting. * DEFAULT: 'H:i' * - history: (boolean) If true, ensures that this event's history is * loaded from the History backend. * DEFAULT: false (Do not ensure history is loaded). * * @return stdClass A simple object. */ public function toJson(array $options = array()) { $options = array_merge(array('all_day' => null, 'full' => false, 'time_format' => 'H:i', 'history' => false), $options); $json = parent::toJson($options); if ($this->_ajaxLink) { $json->aj = $this->_ajaxLink; } elseif ($link = (string) $this->getViewUrl(array(), true, false)) { $json->ln = $link; } if (isset($this->_variableLength)) { $json->vl = $this->_variableLength; } return $json; }