protected function getInfoOrCreate($id = 'id') { if ($this->getRequestParameter($id) === '' || $this->getRequestParameter($id) === null) { $info = new Info(); } else { $info = InfoPeer::retrieveByPk($this->getRequestParameter($id)); $this->forward404Unless($info); } return $info; }
public function executeDelete(sfWebRequest $request) { $request->checkCSRFProtection(); $this->forward404Unless($info = InfoPeer::retrieveByPk($request->getParameter('id')), sprintf('Object info does not exist (%s).', $request->getParameter('id'))); $info->delete(); $this->redirect('blog/index'); }
public function executeControldeacceso(sfWebRequest $request) { $this->info = InfoPeer::retrieveByPk(2); }