Example #1
0
 private function authorTypeHandle(Event $e)
 {
     if ($e === null) {
         throw new Exceptions\NullPointerException("Argument Event cannot be null");
     }
     try {
         $editor = null;
         if ($this->getUserService() !== null) {
             $id = $this->getMixId($e->getAuthor());
             if ($id !== null) {
                 $editor = $this->getUserService()->getUser($id, false);
             }
         }
         $e->setAuthor($editor);
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }
Example #2
0
 public function createEvent(ArrayHash $values)
 {
     try {
         $e = new Event((array) $values);
         $e->setAuthor($this->getUser()->getIdentity());
         $this->eventsService->createEvent($e);
     } catch (\Exception $ex) {
         $this->handleDataSave(null, "this", $ex);
     }
     $this->redirect("default");
 }