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


PHP VCalendar::getComponents方法代码示例

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


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

示例1: 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

示例2: testGetComponents

 function testGetComponents()
 {
     $comp = new VCalendar();
     $comp->add($comp->createProperty('FOO', 'BAR'));
     $comp->add($comp->createComponent('VTODO'));
     $r = $comp->getComponents();
     $this->assertInternalType('array', $r);
     $this->assertEquals(1, count($r));
     $this->assertEquals('VTODO', $r[0]->name);
 }
开发者ID:bodun,项目名称:jorani,代码行数:10,代码来源:ComponentTest.php


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