/** * Updates an existing event * * @param $event Tx_CzSimpleCal_Domain_Model_Event * @return void * @dontvalidate $event */ public function updateAction(Tx_CzSimpleCal_Domain_Model_Event $event) { $this->abortOnInvalidUser($event); $this->view->assign('event', $event); if ($this->isEventValid($event)) { $this->eventRepository->update($event); // update index for event $this->getObjectManager()->get('Tx_CzSimpleCal_Indexer_Event')->update($event); $this->flashMessageContainer->add(sprintf('The event "%s" was updated.', $event->getTitle()), '', t3lib_FlashMessage::OK); $this->clearCache(); $this->logEventLifecycle($event, 2); $this->redirect('list'); } }
/** * create the indexes * * @param Tx_CzSimpleCal_Domain_Model_Event $event */ protected function doCreate($event) { $event->setLastIndexed(new DateTime()); $this->eventRepository->update($event); if (!$event->isEnabled()) { return; } // get all recurrances... foreach ($event->getRecurrances() as $recurrance) { // ...and store them to the repository $instance = Tx_CzSimpleCal_Domain_Model_EventIndex::fromArray($recurrance); $this->eventIndexRepository->add($instance); } // store everything to database manually to allow correct unique hash creation when using scheduler // $this->persistenceManager->persistAll(); }