public function executeDelete(sfWebRequest $request) { $request->checkCSRFProtection(); $this->forward404Unless($Item = ItemPeer::retrieveByPk($request->getParameter('id')), sprintf('Object Item does not exist (%s).', $request->getParameter('id'))); $Item->delete(); $this->redirect('item/index'); }
/** * Get the associated Item object * * @param PropelPDO Optional Connection object. * @return Item The associated Item object. * @throws PropelException */ public function getItem(PropelPDO $con = null) { if ($this->aItem === null && $this->item_id !== null) { $this->aItem = ItemPeer::retrieveByPk($this->item_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->aItem->addItemRecipes($this); */ } return $this->aItem; }