| 1 |
lars |
1 |
public function executeUpdate(sfWebRequest $request)
|
|
|
2 |
{
|
|
|
3 |
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
|
|
|
4 |
$this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject());
|
|
|
5 |
<?php else: ?>
|
|
|
6 |
$this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
|
|
|
7 |
$this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
|
|
|
8 |
$this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>);
|
|
|
9 |
<?php endif; ?>
|
|
|
10 |
|
|
|
11 |
$this->processForm($request, $this->form);
|
|
|
12 |
|
|
|
13 |
$this->setTemplate('edit');
|
|
|
14 |
}
|