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

GeneralSettings::initialize()   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 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\entities\routing\data_nodes\core;
4
5
use EventEspresso\core\services\json\JsonDataNode;
6
use EventEspresso\core\services\json\JsonDataNodeValidator;
7
8
/**
9
 * Class GeneralSettings
10
 *
11
 * @package EventEspresso\core\domain\entities\routing\data_nodes
12
 * @author  Brent Christensen
13
 * @since   $VID:$
14
 */
15
class GeneralSettings extends JsonDataNode
16
{
17
18
    const NODE_NAME = 'generalSettings';
19
20
21
    /**
22
     * JsonDataNodeHandler constructor.
23
     *
24
     * @param JsonDataNodeValidator $validator
25
     */
26
    public function __construct(JsonDataNodeValidator $validator)
27
    {
28
        parent::__construct($validator);
29
        $this->setNodeName(GeneralSettings::NODE_NAME);
30
    }
31
32
33
    /**
34
     * @inheritDoc
35
     */
36
    public function initialize()
37
    {
38
        $this->addData('dateFormat', get_option('date_format'));
39
        $this->addData('timeFormat', get_option('time_format'));
40
        $this->addData('timezone', get_option('timezone_string'));
41
        $this->addData('__typename', 'GeneralSettings');
42
        $this->setInitialized(true);
43
    }
44
}
45