1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Audiens\AppnexusClient\entity; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class UserSegment |
7
|
|
|
*/ |
8
|
|
|
class UserSegment |
9
|
|
|
{ |
10
|
|
|
|
11
|
|
|
const UUID_SEPARATOR = ','; |
12
|
|
|
const SEGBLOCK_SEPARATOR = ';'; |
13
|
|
|
|
14
|
|
|
//UUID,SEG_ID;SEG_CODE;EXPIRATION;TIMESTAMP;VALUE;MEMBER_ID |
|
|
|
|
15
|
|
|
//5727816213491965430,78610639, "it.gender.male";7776000;1458191702;0;0 |
16
|
|
|
//5727816213491965430,77610639, "it.age.18-24";7776000;1458191702;0;0 |
17
|
|
|
//5727816213491965430,74610639, "it.residence.milan";7776000;1458191702;0;0 |
18
|
|
|
//6427816213491965430,72610639, "it.gender.female";7776000;1458191702;0;0 |
19
|
|
|
//6427816213491965430,71610639, "it.age.25-34";7776000;1458191702;0;0 |
20
|
|
|
//6427816213491965430,70610639, "it.residence.venice"; 7776000;1458191702;0;0 |
21
|
|
|
// |
22
|
|
|
protected $dmpId; |
23
|
|
|
|
24
|
|
|
protected $segmentId; |
25
|
|
|
|
26
|
|
|
protected $segmentCode; |
27
|
|
|
|
28
|
|
|
protected $timestamp; |
29
|
|
|
|
30
|
|
|
protected $value; |
31
|
|
|
|
32
|
|
|
protected $memberId; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @return mixed |
36
|
|
|
*/ |
37
|
|
|
public function getDmpId() |
38
|
|
|
{ |
39
|
|
|
return $this->dmpId; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param mixed $dmpId |
44
|
|
|
*/ |
45
|
|
|
public function setDmpId($dmpId) |
46
|
|
|
{ |
47
|
|
|
$this->dmpId = $dmpId; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @return mixed |
52
|
|
|
*/ |
53
|
|
|
public function getSegmentId() |
54
|
|
|
{ |
55
|
|
|
return $this->segmentId; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param mixed $segmentId |
60
|
|
|
*/ |
61
|
|
|
public function setSegmentId($segmentId) |
62
|
|
|
{ |
63
|
|
|
$this->segmentId = $segmentId; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return mixed |
68
|
|
|
*/ |
69
|
|
|
public function getSegmentCode() |
70
|
|
|
{ |
71
|
|
|
return $this->segmentCode; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param mixed $segmentCode |
76
|
|
|
*/ |
77
|
|
|
public function setSegmentCode($segmentCode) |
78
|
|
|
{ |
79
|
|
|
$this->segmentCode = $segmentCode; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return mixed |
84
|
|
|
*/ |
85
|
|
|
public function getTimestamp() |
86
|
|
|
{ |
87
|
|
|
return $this->timestamp; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param mixed $timestamp |
92
|
|
|
*/ |
93
|
|
|
public function setTimestamp($timestamp) |
94
|
|
|
{ |
95
|
|
|
$this->timestamp = $timestamp; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return mixed |
100
|
|
|
*/ |
101
|
|
|
public function getValue() |
102
|
|
|
{ |
103
|
|
|
return $this->value; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param mixed $value |
108
|
|
|
*/ |
109
|
|
|
public function setValue($value) |
110
|
|
|
{ |
111
|
|
|
$this->value = $value; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return mixed |
116
|
|
|
*/ |
117
|
|
|
public function getMemberId() |
118
|
|
|
{ |
119
|
|
|
return $this->memberId; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param mixed $memberId |
124
|
|
|
*/ |
125
|
|
|
public function setMemberId($memberId) |
126
|
|
|
{ |
127
|
|
|
$this->memberId = $memberId; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @return string |
132
|
|
|
*/ |
133
|
|
|
public function __toString() |
134
|
|
|
{ |
135
|
|
|
|
136
|
|
|
$segBlock = implode( |
137
|
|
|
';', |
138
|
|
|
[ |
139
|
|
|
$this->segmentId, |
140
|
|
|
$this->segmentCode, |
141
|
|
|
$this->timestamp, |
142
|
|
|
$this->value, |
143
|
|
|
$this->memberId, |
144
|
|
|
] |
145
|
|
|
); |
146
|
|
|
|
147
|
|
|
return implode(',', [$this->dmpId, $segBlock]); |
148
|
|
|
|
149
|
|
|
|
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
|
153
|
|
|
} |
154
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.