Commit | Line | Data |
---|---|---|
929ca066 BA |
1 | <?php |
2 | ||
3 | namespace Mixstore\UserBundle\Entity; | |
4 | ||
5 | use FOS\UserBundle\Model\User as BaseUser; | |
6 | use Doctrine\ORM\Mapping as ORM; | |
7 | ||
8 | /** | |
9 | * @ORM\Entity() | |
10 | * @ORM\Table(name="ms_user") | |
11 | */ | |
12 | class User extends BaseUser | |
13 | { | |
14 | /** | |
15 | * @ORM\Id | |
16 | * @ORM\Column(type="integer") | |
17 | * @ORM\GeneratedValue(strategy="AUTO") | |
18 | */ | |
19 | protected $id; | |
20 | ||
21 | /** | |
22 | * @ORM\Column(type="string") | |
23 | */ | |
24 | private $name; | |
25 | ||
26 | /** | |
27 | * @ORM\Column(type="string") | |
28 | */ | |
29 | private $surname; | |
30 | ||
31 | /** | |
32 | * @ORM\Column(type="boolean") | |
33 | */ | |
34 | private $emailnotif0 = false; | |
35 | ||
36 | /** | |
37 | * @ORM\Column(type="boolean") | |
38 | */ | |
39 | private $emailnotif1 = false; | |
40 | ||
41 | public function __construct() | |
42 | { | |
43 | parent::__construct(); | |
44 | } | |
45 | ||
46 | /** | |
47 | * Get id | |
48 | * | |
49 | * @return integer | |
50 | */ | |
51 | public function getId() | |
52 | { | |
53 | return $this->id; | |
54 | } | |
55 | ||
56 | /** | |
57 | * Set name | |
58 | * | |
59 | * @param string $name | |
60 | * @return User | |
61 | */ | |
62 | public function setName($name) | |
63 | { | |
64 | $this->name = $name; | |
65 | ||
66 | return $this; | |
67 | } | |
68 | ||
69 | /** | |
70 | * Get name | |
71 | * | |
72 | * @return string | |
73 | */ | |
74 | public function getName() | |
75 | { | |
76 | return $this->name; | |
77 | } | |
78 | ||
79 | /** | |
80 | * Set surname | |
81 | * | |
82 | * @param string $surname | |
83 | * @return User | |
84 | */ | |
85 | public function setSurname($surname) | |
86 | { | |
87 | $this->surname = $surname; | |
88 | ||
89 | return $this; | |
90 | } | |
91 | ||
92 | /** | |
93 | * Get surname | |
94 | * | |
95 | * @return string | |
96 | */ | |
97 | public function getSurname() | |
98 | { | |
99 | return $this->surname; | |
100 | } | |
101 | ||
102 | /** | |
103 | * Set email (override base behavior) | |
104 | * | |
105 | * @param string $email | |
106 | * @return User | |
107 | */ | |
108 | public function setEmail($email) | |
109 | { | |
110 | //http://stackoverflow.com/questions/8832916/remove-replace-the-username-field-with-email-using-fosuserbundle-in-symfony2 | |
111 | $email = is_null($email) ? '' : $email; | |
112 | parent::setEmail($email); | |
113 | $this->setUsername($email); | |
114 | ||
115 | return $this; | |
116 | } | |
117 | ||
118 | /** | |
119 | * Set emailnotif0 | |
120 | * | |
121 | * @param boolean $emailnotif0 | |
122 | * @return User | |
123 | */ | |
124 | public function setEmailnotif0($emailnotif0) | |
125 | { | |
126 | $this->emailnotif0 = $emailnotif0; | |
127 | ||
128 | return $this; | |
129 | } | |
130 | ||
131 | /** | |
132 | * Get emailnotif0 | |
133 | * | |
134 | * @return boolean | |
135 | */ | |
136 | public function getEmailnotif0() | |
137 | { | |
138 | return $this->emailnotif0; | |
139 | } | |
140 | ||
141 | /** | |
142 | * Set emailnotif1 | |
143 | * | |
144 | * @param boolean $emailnotif1 | |
145 | * @return User | |
146 | */ | |
147 | public function setEmailnotif1($emailnotif1) | |
148 | { | |
149 | $this->emailnotif1 = $emailnotif1; | |
150 | ||
151 | return $this; | |
152 | } | |
153 | ||
154 | /** | |
155 | * Get emailnotif1 | |
156 | * | |
157 | * @return boolean | |
158 | */ | |
159 | public function getEmailnotif1() | |
160 | { | |
161 | return $this->emailnotif1; | |
162 | } | |
163 | } |