| Total Complexity | 9 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 5 | class MissingExtension extends \Twig_Extension |
||
| 6 | { |
||
| 7 | use TwigTrait; |
||
| 8 | |||
| 9 | protected $request; |
||
| 10 | protected $entityManager; |
||
| 11 | protected $shortFunctions; |
||
| 12 | |||
| 13 | public function __construct($requestStack, $entityManager, $container) |
||
| 14 | { |
||
| 15 | $this->request = $requestStack->getCurrentRequest(); |
||
| 16 | $this->entityManager = $entityManager; |
||
| 17 | |||
| 18 | $this->shortFunctions = $container->hasParameter('sludio_helper.script.short_functions') && $container->getParameter('sludio_helper.script.short_functions'); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getName() |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getFilters() |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getObjects($class, $variable, $order = null, $one = false) |
||
| 37 | { |
||
| 38 | $variable = is_array($variable) ? $variable : [$variable]; |
||
| 39 | $order = is_array($order) ? $order : [$order]; |
||
| 40 | |||
| 41 | if ($one) { |
||
| 42 | $objects = $this->entityManager->getRepository($class)->findOneBy($variable, $order); |
||
| 43 | } else { |
||
| 44 | $objects = $this->entityManager->getRepository($class)->findBy($variable, $order); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $objects; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getSvg($svg) |
||
| 53 | } |
||
| 54 | } |
||
| 55 |