toJson() public static method

Converts free/busy data to a simple object suitable to be transferred as json.
public static toJson ( Horde_Icalendar_Vfreebusy $fb ) : object
$fb Horde_Icalendar_Vfreebusy A Free/busy component.
return object A simple object representation.
Ejemplo n.º 1
0
 /**
  * Obtain the freebusy information for this resource.
  *
  * @return mixed string|Horde_Icalendar_Vfreebusy  The Freebusy object or
  *                                                 the iCalendar text.
  */
 public function getFreeBusy($startstamp = null, $endstamp = null, $asObject = false, $json = false)
 {
     $vfb = Kronolith_FreeBusy::generate($this->get('calendar'), $startstamp, $endstamp, true);
     $vfb->removeAttribute('ORGANIZER');
     $vfb->setAttribute('ORGANIZER', $this->get('name'));
     if ($json) {
         return Kronolith_FreeBusy::toJson($vfb);
     } elseif (!$asObject) {
         return $vfb->exportvCalendar();
     }
     return $vfb;
 }