Completed
Branch EDTR/master (83b47e)
by
unknown
25:37 queued 16:41
created

EventEspressoData::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\entities\routing\data_nodes;
4
5
use DomainException;
6
use EventEspresso\core\domain\entities\routing\data_nodes\core\Api;
7
use EventEspresso\core\domain\entities\routing\data_nodes\core\Config;
8
use EventEspresso\core\domain\services\assets\EspressoCoreAppAssetManager;
9
use EventEspresso\core\services\assets\JedLocaleData;
10
use EventEspresso\core\services\json\PrimaryJsonDataNode;
11
use EventEspresso\core\services\json\JsonDataNodeValidator;
12
13
/**
14
 * Class EventEspressoData
15
 * Description
16
 *
17
 * @package EventEspresso\core\domain\entities\routing\data_nodes
18
 * @author  Brent Christensen
19
 * @since   $VID:$
20
 */
21
class EventEspressoData extends PrimaryJsonDataNode
22
{
23
24
    const NODE_NAME = 'eventEspressoData';
25
26
    /**
27
     * @var Api $api
28
     */
29
    private $api;
30
31
    /**
32
     * @var Config $config
33
     */
34
    private $config;
35
36
    /**
37
     * @var JedLocaleData $jed_locale
38
     */
39
    private $jed_locale;
40
41
42
    /**
43
     * JsonDataNodeHandler constructor.
44
     *
45
     * @param Api $api
46
     * @param Config $config
47
     * @param JedLocaleData         $jed_locale
48
     * @param JsonDataNodeValidator $validator
49
     */
50
    public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator)
51
    {
52
        parent::__construct($validator);
53
        $this->api = $api;
54
        $this->config = $config;
55
        $this->jed_locale = $jed_locale;
56
        $this->setNodeName(EventEspressoData::NODE_NAME);
57
    }
58
59
60
    /**
61
     * @throws DomainException
62
     * @since $VID:$
63
     */
64
    public function initialize()
65
    {
66
        $this->addDataNode($this->api);
67
        $this->addDataNode($this->config);
68
        $this->addData('i18n', $this->jed_locale->getData('event_espresso'));
69
        $this->setInitialized(true);
70
    }
71
}
72