本文整理汇总了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);
}
示例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);
}
示例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');
}
}