Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | trait DoctrineHelperTrait |
||
26 | { |
||
27 | public static function getDoctrine(): Registry |
||
28 | { |
||
29 | return static::getClient()->getKernel()->getContainer()->get('doctrine'); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $class |
||
34 | * |
||
35 | * @return ObjectRepository|EntityRepository |
||
36 | */ |
||
37 | public static function getRepository(string $class): ObjectRepository |
||
38 | { |
||
39 | return static::getDoctrine()->getRepository($class); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Find a database record from global id |
||
44 | * |
||
45 | * findOneByGlobalId('VXNlcjox') => object |
||
46 | * |
||
47 | * @param mixed $id |
||
48 | * |
||
49 | * @return NodeInterface |
||
50 | */ |
||
51 | public static function findOneByGlobalId($id) |
||
54 | } |
||
55 | } |
||
56 |