@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @param Object $entity Entity |
| 258 | 258 | * @param Request $request Request in progress |
| 259 | 259 | * @param string $entityName Name of Entity |
| 260 | - * @return array |
|
| 260 | + * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
| 261 | 261 | */ |
| 262 | 262 | public function abstractDeleteWithArticlesAction($entity, Request $request, $entityName) |
| 263 | 263 | { |
@@ -278,6 +278,9 @@ discard block |
||
| 278 | 278 | return $this->redirect($this->generateUrl($entityName)); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | + /** |
|
| 282 | + * @param string $entityName |
|
| 283 | + */ |
|
| 281 | 284 | private function testReturnParam($entity, $entityName) |
| 282 | 285 | { |
| 283 | 286 | $entityArray = ['company', 'settings', 'group', 'tva']; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $this->addRolesAction($form, $entityNew); |
| 154 | 154 | } |
| 155 | 155 | $form->handleRequest($request); |
| 156 | - $return = [$entity => $entityNew, 'form' => $form->createView(),]; |
|
| 156 | + $return = [$entity => $entityNew, 'form' => $form->createView(), ]; |
|
| 157 | 157 | |
| 158 | 158 | if ($form->isValid()) { |
| 159 | 159 | $etm = $this->getDoctrine()->getManager(); |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | public function abstractDeleteWithArticlesAction($entity, Request $request, $entityName) |
| 263 | 263 | { |
| 264 | 264 | $etm = $this->getDoctrine()->getManager(); |
| 265 | - $form = $this->createDeleteForm($entity->getId(), $entityName . '_delete'); |
|
| 265 | + $form = $this->createDeleteForm($entity->getId(), $entityName.'_delete'); |
|
| 266 | 266 | $entityArticles = $etm |
| 267 | - ->getRepository('AppBundle:' . ucfirst($entityName) . 'Articles') |
|
| 267 | + ->getRepository('AppBundle:'.ucfirst($entityName).'Articles') |
|
| 268 | 268 | ->findBy([$entityName => $entity->getId()]); |
| 269 | 269 | |
| 270 | 270 | if ($form->handleRequest($request)->isValid()) { |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | { |
| 317 | 317 | $session = new Session(); |
| 318 | 318 | |
| 319 | - return $session->has('sort.' . $name) ? $session->get('sort.' . $name) : null; |
|
| 319 | + return $session->has('sort.'.$name) ? $session->get('sort.'.$name) : null; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } else { |
| 341 | 341 | $alias = current($qbd->getDQLPart('from'))->getAlias(); |
| 342 | 342 | } |
| 343 | - $qbd->orderBy($alias . '.' . $order['field'], $order['type']); |
|
| 343 | + $qbd->orderBy($alias.'.'.$order['field'], $order['type']); |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |