createGoid() public static method

Create a MAPI GOID from a UID See http://msdn.microsoft.com/en-us/library/ee157690%28v=exchg.80%29
public static createGoid ( string $uid, $options = [] ) : string
$uid string The UID value to encode.
return string A Base64 encoded GOID
Beispiel #1
0
 /**
  * Parses a vEvent into the message properties.
  *
  * @param Horde_Icalendar_Vevent $vevent  The vEvent to parse.
  * @param string $method                  The method (e.g., 'REQUEST').
  *
  * @throws Horde_ActiveSync_Exception
  */
 protected function _parsevEvent($vevent, $method = 'REQUEST')
 {
     if ($method == 'REQUEST') {
         $this->responserequested = '1';
     } else {
         $this->responserequested = '0';
     }
     try {
         $organizer = parse_url($vevent->getAttribute('ORGANIZER'));
         $this->organizer = $organizer['path'];
     } catch (Horde_Icalendar_Exception $e) {
     }
     try {
         $this->globalobjid = Horde_Mapi::createGoid($vevent->getAttribute('UID'));
         $this->starttime = new Horde_Date($vevent->getAttribute('DTSTART'));
         $this->endtime = new Horde_Date($vevent->getAttribute('DTEND'));
     } catch (Horde_Exception $e) {
         throw new Horde_ActiveSync_Exception($e);
     }
     try {
         $this->dtstamp = new Horde_Date($vevent->getAttribute('DTSTAMP'));
     } catch (Horde_Exception $e) {
     }
     try {
         $this->location = Horde_String::truncate($vevent->getAttribute('LOCATION'), 255);
     } catch (Horde_Icalendar_Exception $e) {
     }
     try {
         $class = $vevent->getAttribute('CLASS');
         if (!is_array($class)) {
             $this->sensitivity = $class == 'PRIVATE' ? Horde_ActiveSync_Message_Appointment::SENSITIVITY_PRIVATE : ($class == 'CONFIDENTIAL' ? Horde_ActiveSync_Message_Appointment::SENSITIVITY_CONFIDENTIAL : ($class == 'PERSONAL' ? Horde_ActiveSync_Message_Appointment::SENSITIVITY_PERSONAL : Horde_ActiveSync_Message_Appointment::SENSITIVITY_NORMAL));
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
     try {
         $status = $vevent->getAttribute('STATUS');
         if (!is_array($status)) {
             $status = Horde_String::upper($status);
             $this->busystatus = $status == 'TENTATIVE' ? Horde_ActiveSync_Message_Appointment::BUSYSTATUS_TENTATIVE : ($status == 'CONFIRMED' ? Horde_ActiveSync_Message_Appointment::BUSYSTATUS_BUSY : Horde_ActiveSync_Message_Appointment::BUSYSTATUS_FREE);
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
     // vCalendar 1.0 alarms
     try {
         $alarm = $vevent->getAttribute('AALARM');
         if (!is_array($alarm) && intval($alarm)) {
             $this->reminder = intval($this->starttime->timestamp() - $alarm);
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
     // vCalendar 2.0 alarms
     foreach ($vevent->getComponents() as $alarm) {
         if (!$alarm instanceof Horde_Icalendar_Valarm) {
             continue;
         }
         try {
             $trigger = $alarm->getAttribute('TRIGGER');
             $triggerParams = $alarm->getAttribute('TRIGGER', true);
         } catch (Horde_Icalendar_Exception $e) {
             continue;
         }
         if (isset($triggerParams['VALUE']) && $triggerParams['VALUE'] == 'DATE-TIME') {
             if (isset($triggerParams['RELATED']) && $triggerParams['RELATED'] == 'END') {
                 $this->reminder = intval($this->endtime->timestamp() - $trigger);
             } else {
                 $this->reminder = intval($this->starttime->timestamp() - $trigger);
             }
         } else {
             $this->reminder = -intval($trigger);
         }
     }
 }