Completed
Push — master ( bd8043...d919b4 )
by Francesco
05:20
created

Segment::fromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace Audiens\AppnexusClient\entity;
4
5
/**
6
 * Class Segment
7
 */
8
class Segment
9
{
10
11
    use HydratableTrait;
12
13
    /** @var  int */
14
    protected $id;
15
16
    /** @var  bool */
17
    protected $active = true;
18
19
    /** @var  string */
20
    protected $description;
21
22
    /** @var  int */
23
    protected $member_id;
24
25
    /** @var  string */
26
    protected $code;
27
28
    /** @var  string */
29
    protected $provider;
30
31
    /** @var  float */
32
    protected $price;
33
34
    /** @var  string */
35
    protected $short_name;
36
37
    /** @var  int */
38
    protected $expire_minutes;
39
40
    /** @var  string */
41
    protected $category;
42
43
    /** @var  \Datetime */
44
    protected $last_activity;
45
46
    /**
47
     * Segment constructor
48
     */
49
    public function __construct()
50
    {
51
        $this->active = true;
52
        $this->last_activity = new \DateTime();
53
        $this->price = 0.0;
54
        $this->provider = 'base-provider';
55
        $this->expire_minutes = 2147483647;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getId()
62
    {
63
        return $this->id;
64
    }
65
66
    /**
67
     * @param int $id
68
     */
69
    public function setId($id)
70
    {
71
        $this->id = $id;
72
    }
73
74
    /**
75
     * @return boolean
76
     */
77
    public function isActive()
78
    {
79
        return $this->active;
80
    }
81
82
    /**
83
     * @param boolean $active
84
     */
85
    public function setActive($active)
86
    {
87
        $this->active = $active;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getDescription()
94
    {
95
        return $this->description;
96
    }
97
98
    /**
99
     * @param string $description
100
     */
101
    public function setDescription($description)
102
    {
103
        $this->description = $description;
104
    }
105
106
    /**
107
     * @return int
108
     */
109
    public function getMemberId()
110
    {
111
        return $this->member_id;
112
    }
113
114
    /**
115
     * @param int $memberId
116
     */
117
    public function setMemberId($memberId)
118
    {
119
        $this->member_id = $memberId;
120
    }
121
122
    /**
123
     * @return string
124
     */
125
    public function getCode()
126
    {
127
        return $this->code;
128
    }
129
130
    /**
131
     * @param string $code
132
     */
133
    public function setCode($code)
134
    {
135
        $this->code = $code;
136
    }
137
138
    /**
139
     * @return string
140
     */
141
    public function getProvider()
142
    {
143
        return $this->provider;
144
    }
145
146
    /**
147
     * @param string $provider
148
     */
149
    public function setProvider($provider)
150
    {
151
        $this->provider = $provider;
152
    }
153
154
    /**
155
     * @return float
156
     */
157
    public function getPrice()
158
    {
159
        return $this->price;
160
    }
161
162
    /**
163
     * @param float $price
164
     */
165
    public function setPrice($price)
166
    {
167
        $this->price = $price;
168
    }
169
170
    /**
171
     * @return string
172
     */
173
    public function getName()
174
    {
175
        return $this->short_name;
176
    }
177
178
    /**
179
     * @param string $name
180
     */
181
    public function setName($name)
182
    {
183
        $this->short_name = $name;
184
    }
185
186
    /**
187
     * @return int
188
     */
189
    public function getExpireMinutes()
190
    {
191
        return $this->expire_minutes;
192
    }
193
194
    /**
195
     * @param int $expireMinutes
196
     */
197
    public function setExpireMinutes($expireMinutes)
198
    {
199
        $this->expire_minutes = $expireMinutes;
200
    }
201
202
    /**
203
     * @return string
204
     */
205
    public function getCategory()
206
    {
207
        return $this->category;
208
    }
209
210
    /**
211
     * @param string $category
212
     */
213
    public function setCategory($category)
214
    {
215
        $this->category = $category;
216
    }
217
218
    /**
219
     * @return \Datetime
220
     */
221
    public function getLastActivity()
222
    {
223
        return $this->last_activity;
224
    }
225
226
    /**
227
     * @param \Datetime $lastActivity
228
     */
229
    public function setLastActivity(\Datetime $lastActivity)
230
    {
231
        $this->last_activity = $lastActivity;
232
    }
233
}
234