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


PHP Component::select方法代码示例

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


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

示例1: importVObject


//.........这里部分代码省略.........
     $this->reminder = 0;
     //		if($vobject->valarm && $vobject->valarm->trigger){
     //
     //			$type = (string) $vobject->valarm->trigger["value"];
     //
     //
     //			if($type == "DURATION") {
     //				$duration = \GO\Base\VObject\Reader::parseDuration($vobject->valarm->trigger);
     //				if($duration>0){
     //					$this->reminder = $duration*-1;
     //				}
     //			}else
     //			{
     //				\GO::debug("WARNING: Ignoring unsupported reminder value of type: ".$type);
     //			}
     //
     if ($vobject->valarm && $vobject->valarm->trigger) {
         $date = $vobject->valarm->getEffectiveTriggerTime();
         if ($date) {
             if ($this->all_day_event) {
                 $this->_utcToLocal($date);
             }
             $this->reminder = $this->start_time - $date->format('U');
         }
     } elseif ($vobject->aalarm) {
         //funambol sends old vcalendar 1.0 format
         $aalarm = explode(';', (string) $vobject->aalarm);
         if (!empty($aalarm[0])) {
             $p = Sabre\VObject\DateTimeParser::parse($aalarm[0]);
             $this->reminder = $this->start_time - $p->format('U');
         }
     }
     $this->setAttributes($attributes, false);
     $recurrenceIds = $vobject->select('recurrence-id');
     if (count($recurrenceIds)) {
         //this is a single instance of a recurring series.
         //attempt to find the exception of the recurring series event by uuid
         //and recurrence time so we can set the relation cal_exceptions.exception_event_id=cal_events.id
         $firstMatch = array_shift($recurrenceIds);
         $recurrenceTime = $firstMatch->getDateTime()->format('U');
         $whereCriteria = \GO\Base\Db\FindCriteria::newInstance()->addCondition('calendar_id', $this->calendar_id, '=', 'ev')->addCondition('uuid', $this->uuid, '=', 'ev')->addCondition('time', $recurrenceTime, '=', 't');
         $joinCriteria = \GO\Base\Db\FindCriteria::newInstance()->addCondition('event_id', 'ev.id', '=', 't', true, true);
         $findParams = \GO\Base\Db\FindParams::newInstance()->single()->criteria($whereCriteria)->join(Event::model()->tableName(), $joinCriteria, 'ev');
         $exception = Exception::model()->find($findParams);
         if ($exception) {
             $this->exception_for_event_id = $exception->event_id;
             if (empty($this->name) || $this->name == \GO::t('unnamed')) {
                 $this->name = $exception->mainevent->name;
             }
         } else {
             //exception was not found for this recurrence. Find the recurring series and add the exception.
             $recurringEvent = Event::model()->findByUuid($this->uuid, 0, $this->calendar_id);
             if ($recurringEvent) {
                 \GO::debug("Creating MISSING exception for " . date('c', $recurrenceTime));
                 //aftersave will create Exception
                 $this->exception_for_event_id = $recurringEvent->id;
                 //will be saved later
                 $exception = new Exception();
                 $exception->time = $recurrenceTime;
                 $exception->event_id = $recurringEvent->id;
                 if (empty($this->name) || $this->name == \GO::t('unnamed')) {
                     $this->name = $exception->mainevent->name;
                 }
             } else {
                 //ignore this because the invited participant might not be invited to the series
                 //throw new \Exception("Could not find master event!");
开发者ID:ajaboa,项目名称:crmpuan,代码行数:67,代码来源:Event.php


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