Example #1
0
 public function createEvent(Event $e)
 {
     if ($e === NULL) {
         throw new Exceptions\NullPointerException("Argument Event was null");
     }
     try {
         $e->setEditor($e->getAuthor());
         $e->setUpdated(new DateTime());
         $e->setAlias(Strings::webalize($e->getTitle()));
         $this->sportGroupsTypeHandle($e);
         $this->eventDao->save($e);
         $this->invalidateEntityCache($e);
         $this->onCreate($e);
     } catch (DBALException $ex) {
         $this->logWarning($ex);
         throw new Exceptions\DuplicateEntryException("Event with this title already exist");
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }