Horde_Icalendar_Vfreebusy::getStart PHP Method

getStart() public method

Returns the timestamp of the start of the time period this free busy information covers.
public getStart ( ) : integer
return integer A timestamp.
    public function getStart()
    {
        try {
            return $this->getAttribute('DTSTART');
        } catch (Horde_Icalendar_Exception $e) {
            return count($this->_busyPeriods) ? min(array_keys($this->_busyPeriods)) : false;
        }
    }

Usage Example

Example #1
0
 /**
  * Converts free/busy data to a simple object suitable to be transferred
  * as json.
  *
  * @param Horde_Icalendar_Vfreebusy $fb  A Free/busy component.
  *
  * @return object  A simple object representation.
  */
 public static function toJson(Horde_Icalendar_Vfreebusy $fb)
 {
     $json = new stdClass();
     $start = $fb->getStart();
     if ($start) {
         $start = new Horde_Date($start);
         $json->s = $start->dateString();
     }
     $end = $fb->getEnd();
     if ($end) {
         $end = new Horde_Date($end);
         $json->e = $end->dateString();
     }
     $b = $fb->getBusyPeriods();
     if (empty($b)) {
         $b = new StdClass();
     }
     $new = new StdClass();
     foreach ($b as $from => $to) {
         $from = new Horde_Date($from);
         $to = new Horde_Date($to);
         $new->{$from->toJson()} = $to->toJson();
     }
     $json->b = $new;
     return $json;
 }
All Usage Examples Of Horde_Icalendar_Vfreebusy::getStart