当前位置: 首页>>代码示例>>PHP>>正文


PHP VCalendar::remove方法代码示例

本文整理汇总了PHP中Sabre\VObject\Component\VCalendar::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP VCalendar::remove方法的具体用法?PHP VCalendar::remove怎么用?PHP VCalendar::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sabre\VObject\Component\VCalendar的用法示例。


在下文中一共展示了VCalendar::remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public function render(Diary $diary)
 {
     $vcalendar = new VCalendar();
     $vcalendar->remove('PRODID');
     $vcalendar->add('PRODID', '-//Camdram//NONSGML Show Diary//EN');
     foreach ($diary->getEvents() as $event) {
         $start_time = null;
         $rrule = array();
         if ($event instanceof MultiDayEventInterface) {
             $start_time = new \DateTime($event->getStartDate()->format('Y-m-d') . ' ' . $event->getStartTime()->format('H:i:s'));
             $last_start_time = new \DateTime($event->getEndDate()->format('Y-m-d') . ' ' . $event->getStartTime()->format('H:i:s'));
             $rrule = 'FREQ=DAILY;UNTIL=' . $last_start_time->format('Ymd\\THis\\Z');
         } elseif ($event instanceof SingleDayEventInterface) {
             $start_time = new \DateTime($event->getDate() . ' ' . $event->getStartTime()->format('H:i:s'));
         }
         if ($start_time) {
             $utc = new \DateTimeZone('UTC');
             $start_time->setTimezone($utc);
             $end_time = clone $start_time;
             $end_time->modify('+2 hours');
             $dtstamp = clone $event->getUpdatedAt();
             $dtstamp->setTimezone($utc);
             $params = array('SUMMARY' => $event->getName(), 'LOCATION' => $event->getVenue(), 'UID' => $event->getUid(), 'DTSTAMP' => $dtstamp, 'DTSTART' => $start_time, 'DURATION' => 'PT2H00M00S', 'DESCRIPTION' => $event->getDescription());
             if ($rrule) {
                 $params['RRULE'] = $rrule;
             }
             $vcalendar->add('VEVENT', $params);
         }
     }
     return $vcalendar->serialize();
 }
开发者ID:dstansby,项目名称:camdram,代码行数:31,代码来源:ICalRenderer.php

示例2: processMessageRequest

 /**
  * Processes incoming REQUEST messages.
  *
  * This is message from an organizer, and is either a new event
  * invite, or an update to an existing one.
  *
  *
  * @param Message $itipMessage
  * @param VCalendar $existingObject
  * @return VCalendar|null
  */
 protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null)
 {
     if (!$existingObject) {
         // This is a new invite, and we're just going to copy over
         // all the components from the invite.
         $existingObject = new VCalendar();
         foreach ($itipMessage->message->getComponents() as $component) {
             $existingObject->add(clone $component);
         }
     } else {
         // We need to update an existing object with all the new
         // information. We can just remove all existing components
         // and create new ones.
         foreach ($existingObject->getComponents() as $component) {
             $existingObject->remove($component);
         }
         foreach ($itipMessage->message->getComponents() as $component) {
             $existingObject->add(clone $component);
         }
     }
     return $existingObject;
 }
开发者ID:sksree,项目名称:Jorani_new,代码行数:33,代码来源:Broker.php

示例3: testRemoveNotFound

 /**
  * @expectedException InvalidArgumentException
  */
 function testRemoveNotFound()
 {
     $comp = new VCalendar(array(), false);
     $prop = $comp->createProperty('A', 'B');
     $comp->remove($prop);
 }
开发者ID:bodun,项目名称:jorani,代码行数:9,代码来源:ComponentTest.php


注:本文中的Sabre\VObject\Component\VCalendar::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。