-
Notifications
You must be signed in to change notification settings - Fork 25
/
ThirdSetMauticTimingBundle.php
89 lines (77 loc) · 3.06 KB
/
ThirdSetMauticTimingBundle.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* @package ThirdSetMauticTimingBundle
* @copyright 2016 Third Set Productions. All rights reserved.
* @author Third Set Productions
* @link http://www.thirdset.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace MauticPlugin\ThirdSetMauticTimingBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Mautic\PluginBundle\Bundle\PluginBundleBase;
use MauticPlugin\ThirdSetMauticTimingBundle\DependencyInjection\Compiler\OverrideServiceCompilerPass;
/**
* Class ThirdSetMauticTimingBundle.
*
* @package MauticPlugin\ThirdSetMauticTimingBundle
*/
class ThirdSetMauticTimingBundle extends PluginBundleBase
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
/**
* NOTE: this is declared here (instead of in config.php) so that we
* can inject it into the services defined below in this file.
*/
$container
->register(
'plugin.thirdset.timing.campaign_event_manager',
'MauticPlugin\ThirdSetMauticTimingBundle\Model\TimingModel'
)
->addArgument(new Reference('doctrine.orm.entity_manager'));
/**
* EventType.
* NOTE: this is declared here (instead of in config.php) so that we
* can inject it into the services defined below in this file.
*/
$container
->register(
'plugin.thirdset.timing.timing',
'MauticPlugin\ThirdSetMauticTimingBundle\Form\Type\TimingType'
)
->addArgument(new Reference('session'))
->addArgument(new Reference('plugin.thirdset.timing.campaign_event_manager'))
->addTag('form.type', array('alias' => 'timing'));
/**
* Form Type Extensions.
* Note: these are registered here because Mautic's config system
* doesn't seem to be able to handle complex tags.
*/
$container
->register(
'plugin.thirdset.timing.event_type_extension',
'MauticPlugin\ThirdSetMauticTimingBundle\Form\Extension\EventTypeExtension'
)
->addArgument(new Reference('session'))
->addArgument(new Reference('mautic.campaign.model.event'))
->addArgument(new Reference('plugin.thirdset.timing.event_timing_model'))
->addTag('form.type_extension', array('extended_type' => 'Mautic\CampaignBundle\Form\Type\EventType'));
// Register our custom form theme.
$container->loadFromExtension('framework', array(
'templating' => array(
'form' => array(
'resources' => array(
'ThirdSetMauticTimingBundle:FormTheme\Custom',
),
),
),
));
// Add a compiler pass for overriding mautic services.
$container->addCompilerPass(new OverrideServiceCompilerPass());
}
}