Completed
Branch master (3a3d8d)
by Guillaume
05:03
created

Lead::isArchive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Starkerxp\LeadBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Starkerxp\StructureBundle\Entity\AbstractUser;
7
8
/**
9
 * Lead
10
 *
11
 * @ORM\Table(name="lead", indexes={
12
 *  @ORM\Index(columns={"origin", "external_reference"}),
13
 *  @ORM\Index(columns={"external_reference"}),
14
 *  @ORM\Index(columns={"uuid"}),
15
 *  @ORM\Index(columns={"product"}),
16
 *  @ORM\Index(columns={"date_event"}),
17
 *  @ORM\Index(columns={"created_at"}),
18
 *  @ORM\Index(columns={"updated_at"})
19
 * })
20
 * @ORM\Entity(repositoryClass="Starkerxp\LeadBundle\Repository\LeadRepository")
21
 */
22
class Lead extends AbstractUser
23
{
24
    use \Starkerxp\StructureBundle\Entity\ArchiveTrait;
25
26
    /**
27
     * @var string
28
     *
29
     * @ORM\Column(name="origin", type="string", length=255, nullable=false)
30
     */
31
    protected $origin;
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\Column(name="external_reference", type="string", length=255, nullable=true)
37
     */
38
    protected $externalReference;
39
40
    /**
41
     * @var string
42
     *
43
     * @ORM\Column(name="product", type="string", length=255, nullable=false)
44
     */
45
    protected $product;
46
47
    /**
48
     * @var \Datetime
49
     *
50
     * @ORM\Column(name="date_event", type="datetime", nullable=false)
51
     */
52
    protected $dateEvent;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="ip_address", type="string", length=255, nullable=true)
58
     */
59
    protected $ipAddress;
60
61
    /**
62
     * @var boolean
63
     *
64
     * @ORM\Column(name="is_pixel", type="boolean", nullable=true, options={"default":0})
65
     */
66
    protected $pixel;
67
68
    /**
69
     * Permit to stock other datas.
70
     * @var LeadSerialisation
71
     * @ORM\ManyToOne(targetEntity="LeadSerialisation", cascade="persist")
72
     * @ORM\JoinColumn(name="serialisation_id", referencedColumnName="id")
73
     */
74
    protected $serialisation;
75
76
    /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
77
    protected $firstname;
78
79
    protected $lastname;
80
81
    protected $email;
82
83
    protected $mobile;
84
85
    protected $phoneNumber;
86
87
    protected $address;
88
89
    protected $city;
90
91
    protected $country;
92
93
    protected $gender;
94
95
    protected $birthday;
96
     */
97
98
    /**
99
     * Get origin
100
     *
101
     * @return string
102
     */
103
    public function getOrigin()
104
    {
105
        return $this->origin;
106
    }
107
108
    /**
109
     * Set origin
110
     *
111
     * @param string $origin
112
     *
113
     * @return Lead
114
     */
115
    public function setOrigin($origin)
116
    {
117
        $this->origin = $origin;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Get externalReference
124
     *
125
     * @return string
126
     */
127
    public function getExternalReference()
128
    {
129
        return $this->externalReference;
130
    }
131
132
    /**
133
     * Set externalReference
134
     *
135
     * @param string $externalReference
136
     *
137
     * @return Lead
138
     */
139
    public function setExternalReference($externalReference)
140
    {
141
        $this->externalReference = $externalReference;
142
143
        return $this;
144
    }
145
146
    /**
147
     * Get product
148
     *
149
     * @return string
150
     */
151
    public function getProduct()
152
    {
153
        return $this->product;
154
    }
155
156
    /**
157
     * Set product
158
     *
159
     * @param string $product
160
     *
161
     * @return Lead
162
     */
163
    public function setProduct($product)
164
    {
165
        $this->product = $product;
166
167
        return $this;
168
    }
169
170
    /**
171
     * Get dateEvent
172
     *
173
     * @return \DateTime
174
     */
175
    public function getDateEvent()
176
    {
177
        return $this->dateEvent;
178
    }
179
180
    /**
181
     * Set dateEvent
182
     *
183
     * @param \DateTime $dateEvent
184
     *
185
     * @return Lead
186
     */
187
    public function setDateEvent($dateEvent)
188
    {
189
        $this->dateEvent = $dateEvent;
190
191
        return $this;
192
    }
193
194
    /**
195
     * Get ipAddress
196
     *
197
     * @return string
198
     */
199
    public function getIpAddress()
200
    {
201
        return $this->ipAddress;
202
    }
203
204
    /**
205
     * Set ipAddress
206
     *
207
     * @param string $ipAddress
208
     *
209
     * @return Lead
210
     */
211
    public function setIpAddress($ipAddress)
212
    {
213
        $this->ipAddress = $ipAddress;
214
215
        return $this;
216
    }
217
218
    /**
219
     * Get pixel
220
     *
221
     * @return boolean
222
     */
223
    public function isPixel()
224
    {
225
        return $this->pixel;
226
    }
227
228
    /**
229
     * Set pixel
230
     *
231
     * @param boolean $pixel
232
     *
233
     * @return Lead
234
     */
235
    public function setPixel($pixel)
236
    {
237
        $this->pixel = $pixel;
238
239
        return $this;
240
    }
241
242
    /**
243
     * Get archive
244
     *
245
     * @return boolean
246
     */
247
    public function isArchive()
248
    {
249
        return $this->archive;
250
    }
251
252
    /**
253
     * Get serialisation
254
     *
255
     * @return array|LeadSerialisation
256
     */
257
    public function getSerialisation()
258
    {
259
        if (empty($this->serialisation)) {
260
            return [];
261
        }
262
263
        return $this->serialisation->getSerialisation();
264
    }
265
266
    /**
267
     * Set serialisation
268
     *
269
     * @param \Starkerxp\LeadBundle\Entity\LeadSerialisation $serialisation
270
     *
271
     * @return Lead
272
     */
273
    public function setSerialisation(\Starkerxp\LeadBundle\Entity\LeadSerialisation $serialisation = null)
274
    {
275
        $this->serialisation = $serialisation;
276
277
        return $this;
278
    }
279
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
280