Completed
Push — master ( d52614...d96638 )
by Pedro García
02:43
created

FeaturedFlagsModel::getEndDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace FeaturedFlags;
4
5
class FeaturedFlagsModel
6
{
7
    protected $_status;
8
    protected $_data;
9
    protected $_endDate;
10
11
    public function __construct($status, $data = array(), $endDate = null)
12
    {
13
        $this->_status = $status;
14
        $this->_data = $data;
15
        $this->_endDate = $endDate;
16
    }
17
18
    /**
19
     * @return array
20
     */
21
    public function getParamsArray()
22
    {
23
        if (is_string($this->_data)) {
24
            return json_decode($this->_data, true);
25
        } else {
26
            return array();
27
        }
28
    }
29
30
    public function isEnabled()
31
    {
32
        return $this->_status == true;
33
    }
34
35
36
    public function getEndDate()
37
    {
38
        return $this->_endDate;
39
    }
40
}
41