public function executeIndex(sfWebRequest $request) { $this->forward404Unless($this->activity = ActivityPeer::retrieveByPk($request->getParameter('activityId')), sprintf('Object activity does not exist (%s).', $request->getParameter('activityId'))); $this->reservationreason_list = ReservationreasonPeer::doSelectFromActivity($this->activity->getId()); if (count($this->reservationreason_list) <= 0) { $this->redirect('activity/index'); } }