1 | <?php |
||
29 | class TenantableListener implements EventSubscriberInterface |
||
30 | { |
||
31 | /** |
||
32 | * @var TenantContextInterface |
||
33 | */ |
||
34 | protected $tenantContext; |
||
35 | |||
36 | /** |
||
37 | * @var EntityManagerInterface |
||
38 | */ |
||
39 | protected $entityManager; |
||
40 | |||
41 | /** |
||
42 | * @var RegistryInterface |
||
43 | */ |
||
44 | protected $doctrine; |
||
45 | 96 | ||
46 | /** |
||
47 | 96 | * Construct. |
|
48 | 96 | * |
|
49 | 96 | * @param RegistryInterface $doctrine |
|
50 | * @param TenantContextInterface $tenantContext |
||
51 | */ |
||
52 | public function __construct(RegistryInterface $doctrine, TenantContextInterface $tenantContext) |
||
57 | |||
58 | 96 | /** |
|
59 | 96 | * Enables tenantable filter on kernel.request. |
|
60 | 96 | */ |
|
61 | 96 | public function enable() |
|
73 | |||
74 | /** |
||
75 | * Disabled tenantable filter. |
||
76 | */ |
||
77 | public function disable() |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public static function getSubscribedEvents() |
||
98 | |||
99 | private function lazyLoad() |
||
105 | } |
||
106 |