Completed
Pull Request — master (#137)
by
unknown
14:15
created

Customer::eraseCredentials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use JMS\Serializer\Annotation as Serializer;
7
use Symfony\Component\Security\Core\User\UserInterface;
8
use JMS\Serializer\Annotation\ExclusionPolicy;
9
use JMS\Serializer\Annotation\Expose;
10
use Symfony\Component\Validator\Constraints as Assert;
11
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
12
13
/**
14
 * User.
15
 *
16
 * @ORM\Table(name="customers")
17
 * @ORM\Entity(repositoryClass="AppBundle\Repository\CustomerRepository")
18
 * @UniqueEntity("facebookId")
19
 * @ExclusionPolicy("all")
20
 */
21
class Customer implements UserInterface
22
{
23
    /**
24
     * @var int
25
     *
26
     * @ORM\Column(name="id", type="integer")
27
     * @ORM\Id
28
     * @ORM\GeneratedValue(strategy="AUTO")
29
     */
30
    protected $id;
31
32
    /**
33
     * @var string
34
     *
35
     * @ORM\Column(name="first_name", type="string", length=100, nullable=true)
36
     * @Assert\Regex(pattern="/\d/", match=false)
37
     * @Assert\Type("string")
38
     * @Assert\Length(min=2, max=100)
39
     * @Expose
40
     */
41
    protected $firstName;
42
43
    /**
44
     * @var string
45
     *
46
     * @ORM\Column(name="last_name", type="string", length=100, nullable=true)
47
     * @Assert\Regex(pattern="/\d/", match=false)
48
     * @Assert\Type("string")
49
     * @Assert\Length(min=2, max=100)
50
     * @Expose
51
     */
52
    protected $lastName;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="email", type="string", length=100, nullable=true)
58
     * @Assert\Email()
59
     * @Assert\Type("string")
60
     * @Assert\Length(max=100)
61
     * @Expose
62
     */
63
    protected $email;
64
65
    /**
66
     * @var string
67
     *
68
     * @ORM\Column(name="username", type="string", length=100)
69
     * @Assert\Type("string")
70
     * @Assert\Length(max=100)
71
     */
72
    protected $username;
73
74
    /**
75
     * @var string
76
     *
77
     * @ORM\Column(name="api_key", type="string", length=255, nullable=true)
78
     * @Assert\Type("string")
79
     * @Assert\Length(max=255)
80
     * @Expose
81
     */
82
    private $apiKey;
83
84
    /**
85
     * @var string
86
     *
87
     * @ORM\Column(name="facebook_id", type="string", length=255, nullable=true, unique=true)
88
     * @Assert\Type("string")
89
     * @Assert\Length(max=255)
90
     */
91
    private $facebookId;
92
93
    /**
94
     * Get id.
95
     *
96
     * @return int
97
     */
98
    public function getId()
99
    {
100
        return $this->id;
101
    }
102
103
    /**
104
     * Set apiKey.
105
     *
106
     * @param string $apiKey
107
     *
108
     * @return Customer
109
     */
110
    public function setApiKey($apiKey)
111
    {
112
        $this->apiKey = $apiKey;
113
114
        return $this;
115
    }
116
117
    /**
118
     * Get apiKey.
119
     *
120
     * @return string
121
     */
122
    public function getApiKey()
123
    {
124
        return $this->apiKey;
125
    }
126
127
    /**
128
     * @inheritdoc
129
     */
130
    public function getRoles()
131
    {
132
        return array('ROLE_API');
133
    }
134
135
    /**
136
     * @inheritdoc
137
     */
138
    public function getPassword()
139
    {
140
    }
141
142
    /**
143
     * @inheritdoc
144
     */
145
    public function getSalt()
146
    {
147
    }
148
149
    /**
150
     * @inheritdoc
151
     */
152
    public function eraseCredentials()
153
    {
154
    }
155
156
    /**
157
     * Set facebookId.
158
     *
159
     * @param string $facebookId
160
     *
161
     * @return Customer
162
     */
163
    public function setFacebookId($facebookId)
164
    {
165
        $this->facebookId = $facebookId;
166
167
        return $this;
168
    }
169
170
    /**
171
     * Get facebookId.
172
     *
173
     * @return string
174
     */
175
    public function getFacebookId()
176
    {
177
        return $this->facebookId;
178
    }
179
180
    /**
181
     * Set username.
182
     *
183
     * @param string $username
184
     *
185
     * @return Customer
186
     */
187
    public function setUsername($username)
188
    {
189
        $this->username = $username;
190
191
        return $this;
192
    }
193
194
    /**
195
     * Get username.
196
     *
197
     * @return string
198
     */
199
    public function getUsername()
200
    {
201
        return $this->username;
202
    }
203
204
    /**
205
     * Set firstName.
206
     *
207
     * @param string $firstName
208
     *
209
     * @return Customer
210
     */
211
    public function setFirstName($firstName)
212
    {
213
        $this->firstName = $firstName;
214
215
        return $this;
216
    }
217
218
    /**
219
     * Get firstName.
220
     *
221
     * @return string
222
     */
223
    public function getFirstName()
224
    {
225
        return $this->firstName;
226
    }
227
228
    /**
229
     * Set lastName.
230
     *
231
     * @param string $lastName
232
     *
233
     * @return Customer
234
     */
235
    public function setLastName($lastName)
236
    {
237
        $this->lastName = $lastName;
238
239
        return $this;
240
    }
241
242
    /**
243
     * Get lastName.
244
     *
245
     * @return string
246
     */
247
    public function getLastName()
248
    {
249
        return $this->lastName;
250
    }
251
252
    /**
253
     * Set email.
254
     *
255
     * @param string $email
256
     *
257
     * @return Customer
258
     */
259
    public function setEmail($email)
260
    {
261
        $this->email = $email;
262
263
        return $this;
264
    }
265
266
    /**
267
     * Get email.
268
     *
269
     * @return string
270
     */
271
    public function getEmail()
272
    {
273
        return $this->email;
274
    }
275
}
276