forked from ihqs/ContactBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IHQSContactBundle.php
45 lines (38 loc) · 1.23 KB
/
IHQSContactBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* (c) Antoine Berranger <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace IHQS\ContactBundle;
use IHQS\ContactBundle\DependencyInjection\Compiler\ConnectorPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle as BaseBundle;
class IHQSContactBundle extends BaseBundle
{
public function registerExtensions(ContainerBuilder $container)
{
parent::registerExtensions($container);
$container->addCompilerPass(new ConnectorPass());
}
public function boot()
{
$provider = $this->container->get('ihqs_contact.provider');
$connectors = $this->container->get('ihqs_contact.provider')->getConnectors();
foreach($connectors as $connectorService)
{
$connector = $this->container->get($connectorService);
$connector->register($this->container->get('event_dispatcher'), 0);
$connector->setContainer($this->container);
}
}
public function getNamespace()
{
return __NAMESPACE__;
}
public function getPath()
{
return strtr(__DIR__, '\\', '/');
}
}