public function executeDelete(sfWebRequest $request) { $request->checkCSRFProtection(); $this->forward404Unless($Advice = AdvicePeer::retrieveByPk($request->getParameter('id')), sprintf('Object Advice does not exist (%s).', $request->getParameter('id'))); $Advice->delete(); $this->redirect('advice/index'); }
/** * Get the associated Advice object * * @param PropelPDO Optional Connection object. * @return Advice The associated Advice object. * @throws PropelException */ public function getAdvice(PropelPDO $con = null) { if ($this->aAdvice === null && $this->advice_id !== null) { $this->aAdvice = AdvicePeer::retrieveByPk($this->advice_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->aAdvice->addImagess($this); */ } return $this->aAdvice; }