/** * Executes index action * * @param sfRequest $request A request object */ public function executeIndex(sfWebRequest $request) { $this->weekmail = WeekmailTable::getInstance()->getLastPublished()->fetchOne(); }
public function executeAcceptEvent(sfWebRequest $request) { $weekmail = WeekmailTable::getInstance()->getCurrent()->fetchOne(); if (!$weekmail) { $this->getUser()->setFlash('error', 'Aucun Weekmail en attente de publication !'); $this->redirect('weekmail/index'); } $event = $this->getRoute()->getObject(); $event->setIsWeekmail(false); $weekmail_article = new WeekmailArticle(); $weekmail_article->setAssoId($event->getAssoId()); $weekmail_article->setName($event->getName()); $weekmail_article->setText($event->getDescription()); $weekmail_article->setImage($event->getAffiche()); $weekmail_article->setSummary($event->getSummary()); $weekmail_article->setWeekmailId($weekmail->getId()); $weekmail_article->setEventId($event->getId()); $weekmail_article->save(); $event->save(); $this->redirect('weekmail/index'); }