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


PHP Schedule::setMember方法代码示例

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


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

示例1: updateApiFromEvent

 public function updateApiFromEvent(Google_Service_Calendar_Event $event, Member $member, $publicFlag)
 {
     $conn = $this->getConnection();
     $conn->beginTransaction();
     try {
         $schedule = $this->findOneByApiIdUnique($event->id);
         if ('cancelled' === $event->status) {
             if ($schedule) {
                 $schedule->delete();
             }
             $conn->commit();
             return true;
         }
         if (!$schedule) {
             $schedule = new Schedule();
             $schedule->setApiIdUnique($event->id);
         } elseif ($event->etag === $schedule->api_etag) {
             $conn->rollback();
             return $schedule->id;
         }
         $schedule->setTitle($event->summary);
         $schedule->setBody($event->description);
         $schedule->setMember($member);
         $schedule->setPublicFlag($this->getEventPublicFlag($event, $publicFlag));
         if ($event->start->dateTime) {
             $startDateTime = new DateTime($event->start->dateTime);
             $schedule->setStartDate($startDateTime->format('Y-m-d'));
             $schedule->setStartTime($startDateTime->format('H:i:s'));
         } elseif ($event->start->date) {
             $schedule->setStartDate($event->start->date);
         }
         if ($event->end->dateTime) {
             $endDateTime = new DateTime($event->end->dateTime);
             $schedule->setEndDate($endDateTime->format('Y-m-d'));
             $schedule->setEndTime($endDateTime->format('H:i:s'));
         } elseif ($event->end->date) {
             $schedule->setStartDate($event->end->date);
         }
         $schedule->setApiEtag($event->etag);
         $schedule->save();
         ScheduleMemberTable::getInstance()->updateScheduleMember(array('schedule_id' => $schedule->id, 'member_id' => $schedule->member_id));
         foreach ($event->attendees as $attendee) {
             $memberId = opCalendarPluginToolkit::seekEmailAndGetMemberId($attendee->email);
             if (!$memberId) {
                 continue;
             }
             ScheduleMemberTable::getInstance()->updateScheduleMember(array('schedule_id' => $schedule->id, 'member_id' => $memberId));
         }
         $conn->commit();
     } catch (Exception $e) {
         $conn->rollback();
         throw $e;
     }
     return $schedule->id;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:55,代码来源:PluginScheduleTable.class.php

示例2: save

 public function save($con = null)
 {
     $schedule = new Schedule();
     $schedule->setStartDate($this->getValue('start_date'));
     $schedule->setEndDate($this->getValue('start_date'));
     $schedule->setTitle($this->getValue('title'));
     $schedule->setBody('');
     $schedule->setMember(sfContext::getInstance()->getUser()->getMember());
     $scheduleMember = new ScheduleMember();
     $scheduleMember->setSchedule($schedule);
     $scheduleMember->setMember($schedule->Member);
     $scheduleMember->save($con);
     return $schedule->save($con);
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:14,代码来源:MiniScheduleForm.class.php


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