| 1 |
lars |
1 |
public function executeDelete(sfWebRequest $request)
|
|
|
2 |
{
|
|
|
3 |
$request->checkCSRFProtection();
|
|
|
4 |
|
|
|
5 |
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
|
|
|
6 |
$this->getRoute()->getObject()->delete();
|
|
|
7 |
<?php else: ?>
|
|
|
8 |
$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) ?>));
|
|
|
9 |
$<?php echo $this->getSingularName() ?>->delete();
|
|
|
10 |
<?php endif; ?>
|
|
|
11 |
|
|
|
12 |
<?php if (isset($this->params['route_prefix']) && $this->params['route_prefix']): ?>
|
|
|
13 |
$this->redirect('@<?php echo $this->getUrlForAction('list') ?>');
|
|
|
14 |
<?php else: ?>
|
|
|
15 |
$this->redirect('<?php echo $this->getModuleName() ?>/index');
|
|
|
16 |
<?php endif; ?>
|
|
|
17 |
}
|