public function actionCreate()
 {
     $objValidator = new helpers\Validation();
     $params = array('event_name', 'city', 'country', 'description', 'user_token', 'starttime', 'endtime', 'longitude', 'latitude', 'address');
     try {
         $isRequestValid = $objValidator->validateRequest($params);
         if ($isRequestValid) {
             $userToken = $this->_request->getPost('user_token', null);
             $objUserAuthMdl = new \models\Users();
             $objEventsModel = new \models\Events();
             $userDetails = $objUserAuthMdl->getUserFromToken($userToken);
             if (!$userDetails) {
                 $this->_request->sendErrorResponse(403, 403, 'User token invalid');
             }
             $eventData = array('event_name' => $this->_request->getPost('event_name'), 'city' => $this->_request->getPost('city'), 'country' => $this->_request->getPost('country'), 'description' => $this->_request->getPost('description'), 'address' => $this->_request->getPost('address'), 'start_time' => strtotime($this->_request->getPost('starttime')), 'end_time' => strtotime($this->_request->getPost('endtime')), 'longitude' => $this->_request->getPost('longitude'), 'latitude' => $this->_request->getPost('latitude'), 'date_created' => date('Y-m-d H:i:s'));
             try {
                 $isEventInserted = $objEventsModel->insertEvent($eventData, $userDetails);
                 if ($isEventInserted) {
                     // send push notification
                     $objNotifier = new \models\Pushnotifications();
                     $objNotifier->eventCreateNotifications($eventData, $userDetails);
                     $this->_request->sendSuccessResponse('Event Inserted');
                 } else {
                     $this->_request->sendErrorResponse(500, 500, 'Error inserting event');
                 }
             } catch (\Exception $ex) {
                 $this->_request->sendErrorResponse(500, 500, $ex->getMessage());
             }
         } else {
             $this->_request->sendErrorResponse(403, 403, 'Request cannot be validated');
         }
     } catch (\Exception $e) {
         $this->_request->sendErrorResponse(404, 404, $e->getMessage());
     }
 }