3 // src/Rapsys/UserBundle/Entity/User.php
4 namespace Rapsys\UserBundle\Entity
;
6 class User
implements \Symfony\Component\Security\Core\User\AdvancedUserInterface
, \Serializable
{
53 * @var \Rapsys\UserBundle\Entity\Title
58 * @var \Doctrine\Common\Collections\Collection
65 public function __construct() {
66 $this->active
= false;
67 $this->groups
= new \Doctrine\Common\Collections\
ArrayCollection();
75 public function getId() {
86 public function setMail($mail) {
97 public function getMail() {
104 * @param string $pseudonym
108 public function setPseudonym($pseudonym) {
109 $this->pseudonym
= $pseudonym;
119 public function getPseudonym() {
120 return $this->pseudonym
;
126 * @param string $forename
130 public function setForename($forename) {
131 $this->forename
= $forename;
141 public function getForename() {
142 return $this->forename
;
148 * @param string $surname
152 public function setSurname($surname) {
153 $this->surname
= $surname;
163 public function getSurname() {
164 return $this->surname
;
170 * @param string $password
174 public function setPassword($password) {
175 $this->password
= $password;
185 public function getPassword() {
186 return $this->password
;
192 * @param bool $active
196 public function setActive($active) {
197 $this->active
= $active;
207 public function getActive() {
208 return $this->active
;
214 * @param \DateTime $created
218 public function setCreated($created) {
219 $this->created
= $created;
229 public function getCreated() {
230 return $this->created
;
236 * @param \DateTime $updated
240 public function setUpdated($updated) {
241 $this->updated
= $updated;
251 public function getUpdated() {
252 return $this->updated
;
258 public function setTitle($title) {
259 $this->title
= $title;
267 public function getTitle() {
274 * @param \Rapsys\UserBundle\Entity\Group $group
278 public function addGroup(\Rapsys\UserBundle\Entity\Group
$group) {
279 $this->groups
[] = $group;
287 * @param \Rapsys\UserBundle\Entity\Group $group
289 public function removeGroup(\Rapsys\UserBundle\Entity\Group
$group) {
290 $this->groups
->removeElement($group);
296 * @return \Doctrine\Common\Collections\Collection
298 public function getGroups() {
299 return $this->groups
;
302 public function getRoles() {
303 return $this->groups
->toArray();
306 public function getSalt() {
307 //No salt required with bcrypt
311 public function getUsername() {
315 public function eraseCredentials() {
318 public function serialize() {
319 return serialize(array(
329 public function unserialize($serialized) {
337 ) = unserialize($serialized);
340 public function isAccountNonExpired() {
344 public function isAccountNonLocked() {
348 public function isCredentialsNonExpired() {
352 public function isEnabled() {
353 return $this->active
;