/**
* 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;
}