All pastes #2076064 Raw Edit

Unnamed

public php v1 · immutable
#2076064 ·published 2011-06-07 09:31 UTC
rendered paste body
<?php/** * organization actions. * * @package    restaraunts * @subpackage organization * @author     Alex Kuzmin * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */class organizationActions extends sfActions{  public function executeDone(sfWebRequest $request)  {  }  public function executeNew(sfWebRequest $request)  {    $this->form = new OrganizationForm();  }    public function executeSeek(sfWebRequest $request)  {      $this->state = $request->getParameter('state');      $this->states = StateTable::getInstance()->getAll();            $this->organizations = ( trim($query = $request->getParameter('query')) )      ? Doctrine_Core::getTable('Organization') ->getForLuceneQuery($query,        $request->getParameter('state') , $request->getParameter('city') )      : array();  }  public function executeCreate(sfWebRequest $request)  {    $this->forward404Unless($request->isMethod(sfRequest::POST));    $this->form = new OrganizationForm();    $this->processForm($request, $this->form);    $this->setTemplate('new');  }  protected function processForm(sfWebRequest $request, sfForm $form)  {    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));    if ($form->isValid())    {      $organization = $form->save();      $this->redirect('organization/done');    }  }}