當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。