Example #1
0
 /**
  *
  * @return array
  */
 public function updateAction()
 {
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $id = $this->getRequest()->getParam('id_event');
         $event = EventQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Event with id {$id}"));
         try {
             $this->getEventCatalog()->beginTransaction();
             EventFactory::populate($event, $params);
             $this->getEventCatalog()->update($event);
             $this->getEventCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el Event"));
         } catch (Exception $e) {
             $this->getEventCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('event/list');
 }
Example #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Event
  */
 protected function makeBean($resultset)
 {
     return EventFactory::createFromArray($resultset);
 }