Badge::setNotificationDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
namespace Wonnova\SDK\Model;
3
4
use JMS\Serializer\Annotation as JMS;
5
use Wonnova\SDK\Common\WonnovaDateTimeParserTrait;
6
7
/**
8
 * Class Badge
9
 * @author Wonnova
10
 * @link http://www.wonnova.com
11
 */
12
class Badge extends AbstractModel
13
{
14
    const TYPE_FIRST_OCCURRENCE = 'first_occurrence';
15
    const TYPE_REPETITION       = 'repetition';
16
    const TYPE_CONSECUTIVE_DAYS = 'consecutive_days';
17
    const TYPE_COMBO            = 'combo';
18
19
    use WonnovaDateTimeParserTrait;
20
21
    /**
22
     * @var string
23
     * @JMS\Type("string")
24
     */
25
    private $name;
26
    /**
27
     * @var string
28
     * @JMS\Type("string")
29
     */
30
    private $description;
31
    /**
32
     * @var string
33
     * @JMS\Type("string")
34
     */
35
    private $imageUrl;
36
    /**
37
     * @var string
38
     * @JMS\Type("string")
39
     */
40
    private $type;
41
    /**
42
     * @var \DateTime
43
     * @JMS\Type("WonnovaDateTime")
44
     */
45
    private $notificationDate;
46
47
    /**
48
     * @return string
49
     */
50 4
    public function getName()
51
    {
52 4
        return $this->name;
53
    }
54
55
    /**
56
     * @param string $name
57
     * @return $this
58
     */
59 1
    public function setName($name)
60
    {
61 1
        $this->name = $name;
62 1
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 2
    public function getDescription()
69
    {
70 2
        return $this->description;
71
    }
72
73
    /**
74
     * @param string $description
75
     * @return $this
76
     */
77 1
    public function setDescription($description)
78
    {
79 1
        $this->description = $description;
80 1
        return $this;
81
    }
82
83
    /**
84
     * @return string
85
     */
86 2
    public function getImageUrl()
87
    {
88 2
        return $this->imageUrl;
89
    }
90
91
    /**
92
     * @param string $imageUrl
93
     * @return $this
94
     */
95 1
    public function setImageUrl($imageUrl)
96
    {
97 1
        $this->imageUrl = $imageUrl;
98 1
        return $this;
99
    }
100
101
    /**
102
     * @return string
103
     */
104 2
    public function getType()
105
    {
106 2
        return $this->type;
107
    }
108
109
    /**
110
     * @param string $type
111
     * @return $this
112
     */
113 1
    public function setType($type)
114
    {
115 1
        $this->type = $type;
116 1
        return $this;
117
    }
118
119
    /**
120
     * @return \DateTime
121
     */
122 2
    public function getNotificationDate()
123
    {
124 2
        return $this->notificationDate;
125
    }
126
127
    /**
128
     * @param \DateTime|string $notificationDate
129
     * @return $this
130
     */
131 1
    public function setNotificationDate($notificationDate)
132
    {
133 1
        $this->notificationDate = $this->parseWonnovaDateTime($notificationDate);
134 1
        return $this;
135
    }
136
}
137