Total Complexity | 7 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
5 | class MissingExtension extends \Twig_Extension |
||
6 | { |
||
7 | use TwigTrait; |
||
8 | |||
9 | protected $entityManager; |
||
10 | |||
11 | public function __construct($entityManager, $shortFunctions) |
||
15 | } |
||
16 | |||
17 | public function getFilters() |
||
25 | } |
||
26 | |||
27 | public function getObjects($class, $variable, $order = null, $one = false) |
||
28 | { |
||
29 | $variable = \is_array($variable) ? $variable : [$variable]; |
||
30 | $order = \is_array($order) ? $order : [$order]; |
||
31 | |||
32 | if ($one) { |
||
33 | $objects = $this->entityManager->getRepository($class)->findOneBy($variable, $order); |
||
34 | } else { |
||
35 | $objects = $this->entityManager->getRepository($class)->findBy($variable, $order); |
||
36 | } |
||
37 | |||
38 | return $objects; |
||
39 | } |
||
40 | |||
41 | public function getSvg($svg) |
||
44 | } |
||
45 | } |
||
46 |