Exemplo n.º 1
0
 public function executeEdit()
 {
     $this->message = MessagePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->message);
 }
Exemplo n.º 2
0
 public function executeDelete(sfWebRequest $request)
 {
     $this->user = $this->getUser()->getTemposUser();
     $this->forward404Unless($this->user, 'Only users can access this page.');
     $request->checkCSRFProtection();
     $this->forward404Unless($message = MessagePeer::retrieveByPk($request->getParameter('id')), sprintf('Object message does not exist (%s).', $request->getParameter('id')));
     $this->forward404Unless($message->isOwned($this->user->getId()), 'You cannot delete other people messages.');
     $message->delete();
     $this->redirect('message/index');
 }