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


PHP Event::saveEvent方法代码示例

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


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

示例1: submitEvent

 public function submitEvent(Request $request)
 {
     $data = json_decode($request->getContent());
     $event = new Event();
     $event->name = $data->event->name;
     if (array_key_exists('public', $data->event)) {
         $event->public = true;
     } else {
         $event->public = '';
     }
     $event->location = $data->event->location;
     $event->description = $data->event->description;
     $event->date = $data->event->date;
     $event->stime = $data->event->stime;
     $event->etime = $data->event->etime;
     $event->uid = Auth::user()->uid;
     try {
         $saveflag = Event::saveEvent($event);
     } catch (Exception $e) {
         print '<script type="text/javascript">';
         print 'alert("The system has encountered an error please try again later")';
         print '</script>';
     }
     $this->validatePoll($request, $event->eid);
     $this->splitEmails($data->emails[0], $event->eid);
     ApiEventItemController::submitItems($request, $event->eid);
 }
开发者ID:umSoftEng2GrpE,项目名称:partEZ,代码行数:27,代码来源:ApiCreateEventController.php

示例2: editEvent

 public function editEvent(Request $request)
 {
     $input = json_decode($request->getContent());
     $event = Event::find($input->event->eid);
     if (array_key_exists('name', $input->event)) {
         $event->name = $input->event->name;
     }
     if (array_key_exists('location', $input->event)) {
         $event->location = $input->event->location;
     }
     if (array_key_exists('description', $input->event)) {
         $event->description = $input->event->description;
     }
     if (array_key_exists('date', $input->event)) {
         $event->date = $input->event->date;
     }
     if (array_key_exists('stime', $input->event)) {
         $event->stime = $input->event->stime;
     }
     if (array_key_exists('etime', $input->event)) {
         $event->etime = $input->event->etime;
     }
     Event::saveEvent($event);
 }
开发者ID:umSoftEng2GrpE,项目名称:partEZ,代码行数:24,代码来源:ApiEditEventController.php

示例3: store

 public function store()
 {
     $input = Request::all();
     $event = new Event();
     $event->name = $input['name'];
     if (array_key_exists('public', $input)) {
         $event->public = true;
     } else {
         $event->public = '';
     }
     $event->location = $input['location'];
     $event->city = $input['city'];
     $event->description = $input['description'];
     $event->date = $input['date'];
     $event->stime = $input['stime'];
     $event->etime = $input['etime'];
     $event->max_attendees = $input['max_attendees'];
     $event->attendees = 0;
     $event->uid = Auth::user()['uid'];
     if (array_key_exists('hastickets', $input)) {
         $event->hastickets = true;
         $event->numtickets = $input['ticketcount'];
         $event->ticketprice = $input['ticketprice'];
     } else {
         $event->hastickets = '';
         $event->numtickets = 0;
         $event->ticketprice = 0.0;
     }
     try {
         $saveflag = Event::saveEvent($event);
     } catch (Exception $e) {
         print '<script type="text/javascript">';
         print 'alert("The system has encountered an error please try again later")';
         print '</script>';
         return view('errors.error_event');
     }
     if ($input['returnlist']) {
         EventItemController::submitItems($event->eid);
     }
     if ($input['email-list']) {
         $this->splitEmails($event->eid);
     }
     if ($input['returndatepolls']) {
         $this->validatePoll($event->eid);
     }
     if ($saveflag) {
         return view('events/success_event');
     }
 }
开发者ID:umSoftEng2GrpE,项目名称:partEZ,代码行数:49,代码来源:EventController.php


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