9
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
11
class profileActions extends sfActions
13
public function executeIndex(sfWebRequest $request)
15
$this->sf_guard_user_profiles = Doctrine_Core::getTable('sfGuardUserProfile')
20
public function executeNew(sfWebRequest $request)
22
$this->form = new sfGuardUserProfileForm();
25
public function executeCreate(sfWebRequest $request)
27
$this->forward404Unless($request->isMethod(sfRequest::POST));
29
$this->form = new sfGuardUserProfileForm();
31
$this->processForm($request, $this->form);
33
$this->setTemplate('new');
36
public function executeEdit(sfWebRequest $request)
38
$this->forward404Unless($sf_guard_user_profile = Doctrine_Core::getTable('sfGuardUserProfile')->find(array($request->getParameter('id'))), sprintf('Object sf_guard_user_profile does not exist (%s).', $request->getParameter('id')));
39
$this->form = new sfGuardUserProfileForm($sf_guard_user_profile);
42
public function executeUpdate(sfWebRequest $request)
44
$this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
45
$this->forward404Unless($sf_guard_user_profile = Doctrine_Core::getTable('sfGuardUserProfile')->find(array($request->getParameter('id'))), sprintf('Object sf_guard_user_profile does not exist (%s).', $request->getParameter('id')));
46
$this->form = new sfGuardUserProfileForm($sf_guard_user_profile);
48
$this->processForm($request, $this->form);
50
$this->setTemplate('edit');
53
public function executeDelete(sfWebRequest $request)
55
$request->checkCSRFProtection();
57
$this->forward404Unless($sf_guard_user_profile = Doctrine_Core::getTable('sfGuardUserProfile')->find(array($request->getParameter('id'))), sprintf('Object sf_guard_user_profile does not exist (%s).', $request->getParameter('id')));
58
$sf_guard_user_profile->delete();
60
$this->redirect('profile/index');
63
protected function processForm(sfWebRequest $request, sfForm $form)
65
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
68
$sf_guard_user_profile = $form->save();
70
$this->redirect('profile/edit?id='.$sf_guard_user_profile->getId());