Completed
Push — master ( c5d644...a435b5 )
by Guillaume
02:45
created

Lead::setExternalReference()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Starkerxp\LeadBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Starkerxp\StructureBundle\Entity\UserArchiveEntity;
7
use Starkerxp\StructureBundle\Manager\EntityReadOnlyInterface;
8
9
/**
10
 * Lead
11
 *
12
 * @ORM\Table(name="lead", indexes={
13
 *  @ORM\Index(columns={"origin", "external_reference"}),
14
 *  @ORM\Index(columns={"external_reference"}),
15
 *  @ORM\Index(columns={"uuid"}),
16
 *  @ORM\Index(columns={"created_at"}),
17
 *  @ORM\Index(columns={"updated_at"})
18
 * })
19
 * @ORM\Entity(repositoryClass="Starkerxp\LeadBundle\Repository\LeadRepository")
20
 */
21
class Lead extends UserArchiveEntity
22
{
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="origin", type="string", length=255, nullable=false)
27
     */
28
    protected $origin;
29
30
    /**
31
     * Optionnal for reimport or update
32
     * @var string
33
     *
34
     * @ORM\Column(name="external_reference", type="string", length=255, nullable=true)
35
     */
36
    protected $externalReference;
37
38
    /**
39
     * @var string
40
     *
41
     * @ORM\Column(name="product", type="string", length=255, nullable=false)
42
     */
43
    protected $product;
44
45
    /**
46
     * @var \Datetime
47
     *
48
     * @ORM\Column(name="date_event", type="datetime", nullable=false)
49
     */
50
    protected $dateEvent;
51
52
    /**
53
     * @var string
54
     *
55
     * @ORM\Column(name="ip_address", type="string", length=255, nullable=true)
56
     */
57
    protected $ipAddress;
58
59
    /**
60
     * @var boolean
61
     *
62
     * @ORM\Column(name="is_pixel", type="boolean", nullable=true, options={"default":0})
63
     */
64
    protected $pixel;
65
66
    /**
67
     * Permit to stock other datas.
68
     * @ORM\ManyToOne(targetEntity="LeadSerialisation", cascade="persist")
69
     * @ORM\JoinColumn(name="serialisation_id", referencedColumnName="id")
70
     */
71
    protected $serialisation;
72
73
    /*
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...
74
    protected $firstname;
75
76
    protected $lastname;
77
78
    protected $email;
79
80
    protected $mobile;
81
82
    protected $phoneNumber;
83
84
    protected $address;
85
86
    protected $city;
87
88
    protected $country;
89
90
    protected $gender;
91
92
    protected $birthday;
93
     */
94
95
    /**
96
     * Set origin
97
     *
98
     * @param string $origin
99
     *
100
     * @return Lead
101
     */
102
    public function setOrigin($origin)
103
    {
104
        $this->origin = $origin;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get origin
111
     *
112
     * @return string
113
     */
114
    public function getOrigin()
115
    {
116
        return $this->origin;
117
    }
118
119
    /**
120
     * Set externalReference
121
     *
122
     * @param string $externalReference
123
     *
124
     * @return Lead
125
     */
126
    public function setExternalReference($externalReference)
127
    {
128
        $this->externalReference = $externalReference;
129
130
        return $this;
131
    }
132
133
    /**
134
     * Get externalReference
135
     *
136
     * @return string
137
     */
138
    public function getExternalReference()
139
    {
140
        return $this->externalReference;
141
    }
142
143
    /**
144
     * Set product
145
     *
146
     * @param string $product
147
     *
148
     * @return Lead
149
     */
150
    public function setProduct($product)
151
    {
152
        $this->product = $product;
153
154
        return $this;
155
    }
156
157
    /**
158
     * Get product
159
     *
160
     * @return string
161
     */
162
    public function getProduct()
163
    {
164
        return $this->product;
165
    }
166
167
    /**
168
     * Set dateEvent
169
     *
170
     * @param \DateTime $dateEvent
171
     *
172
     * @return Lead
173
     */
174
    public function setDateEvent($dateEvent)
175
    {
176
        $this->dateEvent = $dateEvent;
177
178
        return $this;
179
    }
180
181
    /**
182
     * Get dateEvent
183
     *
184
     * @return \DateTime
185
     */
186
    public function getDateEvent()
187
    {
188
        return $this->dateEvent;
189
    }
190
191
    /**
192
     * Set ipAddress
193
     *
194
     * @param string $ipAddress
195
     *
196
     * @return Lead
197
     */
198
    public function setIpAddress($ipAddress)
199
    {
200
        $this->ipAddress = $ipAddress;
201
202
        return $this;
203
    }
204
205
    /**
206
     * Get ipAddress
207
     *
208
     * @return string
209
     */
210
    public function getIpAddress()
211
    {
212
        return $this->ipAddress;
213
    }
214
215
    /**
216
     * Set pixel
217
     *
218
     * @param boolean $pixel
219
     *
220
     * @return Lead
221
     */
222
    public function setPixel($pixel)
223
    {
224
        $this->pixel = $pixel;
225
226
        return $this;
227
    }
228
229
    /**
230
     * Get pixel
231
     *
232
     * @return boolean
233
     */
234
    public function getPixel()
235
    {
236
        return $this->pixel;
237
    }
238
239
    /**
240
     * Get archive
241
     *
242
     * @return boolean
243
     */
244
    public function getArchive()
245
    {
246
        return $this->archive;
247
    }
248
249
    /**
250
     * Set serialisation
251
     *
252
     * @param \Starkerxp\LeadBundle\Entity\LeadSerialisation $serialisation
253
     *
254
     * @return Lead
255
     */
256
    public function setSerialisation(\Starkerxp\LeadBundle\Entity\LeadSerialisation $serialisation = null)
257
    {
258
        $this->serialisation = $serialisation;
259
260
        return $this;
261
    }
262
263
    /**
264
     * Get serialisation
265
     *
266
     * @return array|LeadSerialisation
267
     */
268
    public function getSerialisation()
269
    {
270
        if(empty($this->serialisation)){
271
            return [];
272
        }
273
        return $this->serialisation->getSerialisation();
274
    }
275
}
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...
276