Exemple #1
0
 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');
 }
Exemple #3
0
 public function executeControldeacceso(sfWebRequest $request)
 {
     $this->info = InfoPeer::retrieveByPk(2);
 }