当前位置: 首页>>代码示例>>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;未经允许,请勿转载。