當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Horde_Icalendar::getAttributeValues方法代碼示例

本文整理匯總了PHP中Horde_Icalendar::getAttributeValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP Horde_Icalendar::getAttributeValues方法的具體用法?PHP Horde_Icalendar::getAttributeValues怎麽用?PHP Horde_Icalendar::getAttributeValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Horde_Icalendar的用法示例。


在下文中一共展示了Horde_Icalendar::getAttributeValues方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _handlevEventRecurrence

 /**
  * Parses the various exception related fields. Only deal with the EXDATE
  * field here.
  *
  * @param Horde_Icalendar $vEvent  The vEvent part.
  */
 protected function _handlevEventRecurrence($vEvent)
 {
     // Recurrence.
     try {
         $rrule = $vEvent->getAttribute('RRULE');
         if (!is_array($rrule)) {
             $this->recurrence = new Horde_Date_Recurrence($this->start);
             if (strpos($rrule, '=') !== false) {
                 $this->recurrence->fromRRule20($rrule);
             } else {
                 $this->recurrence->fromRRule10($rrule);
             }
             // Exceptions. EXDATE represents deleted events, just add the
             // exception, no new event is needed.
             $exdates = $vEvent->getAttributeValues('EXDATE');
             if (is_array($exdates)) {
                 foreach ($exdates as $exdate) {
                     if (is_array($exdate)) {
                         $this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
                     }
                 }
             }
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
 }
開發者ID:jubinpatel,項目名稱:horde,代碼行數:32,代碼來源:Ical.php

示例2: _handlevEventRecurrence

 /**
  * Handle parsing recurrence related fields.
  *
  * @param Horde_Icalendar $vEvent
  * @throws Kronolith_Exception
  */
 protected function _handlevEventRecurrence($vEvent)
 {
     // Recurrence.
     try {
         $rrule = $vEvent->getAttribute('RRULE');
         if (!is_array($rrule)) {
             $this->recurrence = new Horde_Date_Recurrence($this->start);
             if (strpos($rrule, '=') !== false) {
                 $this->recurrence->fromRRule20($rrule);
             } else {
                 $this->recurrence->fromRRule10($rrule);
             }
             /* Delete all existing exceptions to this event if it
              * already exists */
             if (!empty($this->uid)) {
                 $kronolith_driver = Kronolith::getDriver(null, $this->calendar);
                 $search = new StdClass();
                 $search->start = $this->recurrence->getRecurStart();
                 $search->end = $this->recurrence->getRecurEnd();
                 $search->baseid = $this->uid;
                 $results = $kronolith_driver->search($search);
                 foreach ($results as $days) {
                     foreach ($days as $exception) {
                         $kronolith_driver->deleteEvent($exception->id);
                     }
                 }
             }
             // Exceptions. EXDATE represents deleted events, just add the
             // exception, no new event is needed.
             $exdates = $vEvent->getAttributeValues('EXDATE');
             if (is_array($exdates)) {
                 foreach ($exdates as $exdate) {
                     if (is_array($exdate)) {
                         $this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
                     }
                 }
             }
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
     // RECURRENCE-ID indicates that this event represents an exception
     try {
         $recurrenceid = $vEvent->getAttribute('RECURRENCE-ID');
         $kronolith_driver = Kronolith::getDriver(null, $this->calendar);
         $originaldt = new Horde_Date($recurrenceid);
         $this->exceptionoriginaldate = $originaldt;
         $this->baseid = $this->uid;
         $this->uid = null;
         try {
             $originalEvent = $kronolith_driver->getByUID($this->baseid);
             $originalEvent->recurrence->addException($originaldt->format('Y'), $originaldt->format('m'), $originaldt->format('d'));
             $originalEvent->save();
         } catch (Horde_Exception_NotFound $e) {
             throw new Kronolith_Exception(_("Unable to locate original event series."));
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
 }
開發者ID:DSNS-LAB,項目名稱:Dmail,代碼行數:64,代碼來源:Event.php

示例3: _handlevEventRecurrence

 /**
  * Handle parsing recurrence related fields.
  *
  * @param Horde_Icalendar $vEvent
  * @throws Kronolith_Exception
  */
 protected function _handlevEventRecurrence($vEvent)
 {
     // Recurrence.
     try {
         $rrule = $vEvent->getAttribute('RRULE');
         if (!is_array($rrule)) {
             $this->recurrence = new Horde_Date_Recurrence($this->start);
             if (strpos($rrule, '=') !== false) {
                 $this->recurrence->fromRRule20($rrule);
             } else {
                 $this->recurrence->fromRRule10($rrule);
             }
             // Exceptions. EXDATE represents deleted events, just add the
             // exception, no new event is needed.
             $exdates = $vEvent->getAttributeValues('EXDATE');
             if (is_array($exdates)) {
                 foreach ($exdates as $exdate) {
                     if (is_array($exdate)) {
                         $this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
                     }
                 }
             }
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
     // RECURRENCE-ID indicates that this event represents an exception
     try {
         $this->recurrenceid = $vEvent->getAttribute('RECURRENCE-ID');
         $originaldt = new Horde_Date($this->recurrenceid);
         $this->exceptionoriginaldate = $originaldt;
         $this->baseid = $this->uid;
         $this->uid = null;
         try {
             $originalEvent = $this->getDriver()->getByUID($this->baseid);
             $originalEvent->recurrence->addException($originaldt->format('Y'), $originaldt->format('m'), $originaldt->format('d'));
             $originalEvent->save();
         } catch (Horde_Exception_NotFound $e) {
             throw new Kronolith_Exception(_("Unable to locate original event series."));
         }
     } catch (Horde_Icalendar_Exception $e) {
     }
 }
開發者ID:GenerationLabs,項目名稱:horde,代碼行數:48,代碼來源:Event.php


注:本文中的Horde_Icalendar::getAttributeValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。