-
Notifications
You must be signed in to change notification settings - Fork 2
/
ConfigResolverAwareFactory.php
39 lines (35 loc) · 1.28 KB
/
ConfigResolverAwareFactory.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
<?php
/**
* This file is part of the EzSystemsMarketingAutomationBundle package
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\MarketingAutomationBundle\DependencyInjection\Factory;
use eZ\Publish\Core\MVC\ConfigResolverInterface;
use EzSystems\MarketingAutomationBundle\EventListener\TrackerListener;
/**
* Factory for services that depend on a legacy configuration variable
*/
class ConfigResolverAwareFactory
{
/** @var \eZ\Publish\Core\MVC\ConfigResolverInterface $configResolver */
protected $configResolver;
/**
* @param \eZ\Publish\Core\MVC\ConfigResolverInterface $configResolver
*/
public function __construct( ConfigResolverInterface $configResolver )
{
$this->configResolver = $configResolver;
}
/**
* @return \EzSystems\MarketingAutomationBundle\EventListener\TrackerListener
*/
public function buildTrackerListener()
{
return new TrackerListener(
$this->configResolver->getParameter( 'TrackingSettings.AutomaticTracking', 'ezma' ) === 'enabled',
$this->configResolver->getParameter( 'TrackingSettings.InstallationId', 'ezma' )
);
}
}