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

GeneralSettings   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A initialize() 0 8 1
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