public function executeDelete(sfWebRequest $request) { $request->checkCSRFProtection(); $this->forward404Unless($Menu = MenuPeer::retrieveByPk($request->getParameter('id')), sprintf('Object Menu does not exist (%s).', $request->getParameter('id'))); $Menu->delete(); $this->redirect('menu/index'); }
/** * Get the associated Menu object * * @param PropelPDO Optional Connection object. * @return Menu The associated Menu object. * @throws PropelException */ public function getMenu(PropelPDO $con = null) { if ($this->aMenu === null && ($this->menu_id !== "" && $this->menu_id !== null)) { $this->aMenu = MenuPeer::retrieveByPk($this->menu_id); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aMenu->addMenuItems($this); */ } return $this->aMenu; }