@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $roles = ['ROLE_ADMIN', 'ROLE_SUPER_ADMIN']; |
| 63 | 63 | switch ($entityName) { |
| 64 | 64 | case 'Article': |
| 65 | - if($this->getUser() !== null && in_array($this->getUser()->getRoles()[0], $roles)) { |
|
| 65 | + if ($this->getUser() !== null && in_array($this->getUser()->getRoles()[0], $roles)) { |
|
| 66 | 66 | $entities = $etm->getRepository('AppBundle:'.$entityName)->getAllArticles(); |
| 67 | 67 | } else { |
| 68 | 68 | $entities = $etm->getRepository('AppBundle:'.$entityName)->getArticles(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | 'action' => $this->generateUrl(strtolower($entity).'_create'), |
| 157 | 157 | )); |
| 158 | 158 | $form->handleRequest($request); |
| 159 | - $return = [$entity => $entityNew, 'form' => $form->createView(),]; |
|
| 159 | + $return = [$entity => $entityNew, 'form' => $form->createView(), ]; |
|
| 160 | 160 | |
| 161 | 161 | if ($form->isValid()) { |
| 162 | 162 | $etm = $this->getDoctrine()->getManager(); |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | { |
| 295 | 295 | $session = new Session(); |
| 296 | 296 | |
| 297 | - return $session->has('sort.' . $name) ? $session->get('sort.' . $name) : null; |
|
| 297 | + return $session->has('sort.'.$name) ? $session->get('sort.'.$name) : null; |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | } else { |
| 319 | 319 | $alias = current($qbd->getDQLPart('from'))->getAlias(); |
| 320 | 320 | } |
| 321 | - $qbd->orderBy($alias . '.' . $order['field'], $order['type']); |
|
| 321 | + $qbd->orderBy($alias.'.'.$order['field'], $order['type']); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |