|
@@ 114-118 (lines=5) @@
|
| 111 |
|
$etm->flush(); |
| 112 |
|
$this->addFlash('info', 'gestock.create.ok'); |
| 113 |
|
|
| 114 |
|
if ($entity === 'company' || $entity === 'settings' || $entity === 'tva') { |
| 115 |
|
$param = array('id' => $entityNew->getId()); |
| 116 |
|
} else { |
| 117 |
|
$param = array('slug' => $entityNew->getSlug()); |
| 118 |
|
} |
| 119 |
|
$return = $form->get('addmore')->isClicked() |
| 120 |
|
? $entity.'_new' |
| 121 |
|
: $entity.'_show'; |
|
@@ 139-143 (lines=5) @@
|
| 136 |
|
*/ |
| 137 |
|
public function abstractEditAction($entity, $entityName, $typePath) |
| 138 |
|
{ |
| 139 |
|
if ($entityName === 'company' || $entityName === 'settings' || $entityName === 'tva') { |
| 140 |
|
$param = array('id' => $entity->getId()); |
| 141 |
|
} else { |
| 142 |
|
$param = array('slug' => $entity->getSlug()); |
| 143 |
|
} |
| 144 |
|
$editForm = $this->createForm(new $typePath(), $entity, array( |
| 145 |
|
'action' => $this->generateUrl($entityName.'_update', $param), |
| 146 |
|
'method' => 'PUT', |
|
@@ 168-172 (lines=5) @@
|
| 165 |
|
*/ |
| 166 |
|
public function abstractUpdateAction($entity, Request $request, $entityName, $typePath) |
| 167 |
|
{ |
| 168 |
|
if ($entityName === 'company' || $entityName === 'settings' || $entityName === 'tva') { |
| 169 |
|
$param = array('id' => $entity->getId()); |
| 170 |
|
} else { |
| 171 |
|
$param = array('slug' => $entity->getSlug()); |
| 172 |
|
} |
| 173 |
|
$editForm = $this->createForm(new $typePath(), $entity, array( |
| 174 |
|
'action' => $this->generateUrl($entityName.'_update', $param), |
| 175 |
|
'method' => 'PUT', |