2012-07-01 17:11:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace KekRozsak\FrontBundle\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
2012-07-02 20:41:06 +00:00
|
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
2012-07-01 17:11:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* KekRozsak\FrontBundle\Entity\User
|
|
|
|
*/
|
2012-07-02 20:41:06 +00:00
|
|
|
class User implements UserInterface
|
2012-07-01 17:11:31 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var integer $id
|
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $username
|
|
|
|
*/
|
|
|
|
private $username;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $password
|
|
|
|
*/
|
|
|
|
private $password;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $email
|
|
|
|
*/
|
|
|
|
private $email;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var DateTime $registered_at
|
|
|
|
*/
|
|
|
|
private $registered_at;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $display_name
|
|
|
|
*/
|
|
|
|
private $display_name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Doctrine\Common\Collections\ArrayCollection
|
|
|
|
*/
|
|
|
|
private $roles;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->roles = new \Doctrine\Common\Collections\ArrayCollection();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get id
|
|
|
|
*
|
|
|
|
* @return integer
|
|
|
|
*/
|
|
|
|
public function getId()
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set username
|
|
|
|
*
|
|
|
|
* @param string $username
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setUsername($username)
|
|
|
|
{
|
|
|
|
$this->username = $username;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get username
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUsername()
|
|
|
|
{
|
|
|
|
return $this->username;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set password
|
|
|
|
*
|
|
|
|
* @param string $password
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setPassword($password)
|
|
|
|
{
|
|
|
|
$this->password = $password;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get password
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getPassword()
|
|
|
|
{
|
|
|
|
return $this->password;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set email
|
|
|
|
*
|
|
|
|
* @param string $email
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setEmail($email)
|
|
|
|
{
|
|
|
|
$this->email = $email;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get email
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getEmail()
|
|
|
|
{
|
|
|
|
return $this->email;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set registered_at
|
|
|
|
*
|
|
|
|
* @param DateTime $registeredAt
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setRegisteredAt(\DateTime $registeredAt)
|
|
|
|
{
|
|
|
|
$this->registered_at = $registeredAt;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get registered_at
|
|
|
|
*
|
|
|
|
* @return DateTime
|
|
|
|
*/
|
|
|
|
public function getRegisteredAt()
|
|
|
|
{
|
|
|
|
return $this->registered_at;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set display_name
|
|
|
|
*
|
|
|
|
* @param string $displayName
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setDisplayName($displayName)
|
|
|
|
{
|
|
|
|
$this->display_name = $displayName;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get display_name
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getDisplayName()
|
|
|
|
{
|
|
|
|
return $this->display_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add roles
|
|
|
|
*
|
|
|
|
* @param KekRozsak\FrontBundle\Entity\Role $roles
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function addRole(\KekRozsak\FrontBundle\Entity\Role $roles)
|
|
|
|
{
|
|
|
|
$this->roles[] = $roles;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get roles
|
|
|
|
*
|
|
|
|
* @return Doctrine\Common\Collections\Collection
|
|
|
|
*/
|
|
|
|
public function getRoles()
|
|
|
|
{
|
2012-07-02 20:41:06 +00:00
|
|
|
return $this->roles->toArray();
|
2012-07-01 17:11:31 +00:00
|
|
|
}
|
2012-07-02 20:41:06 +00:00
|
|
|
|
|
|
|
public function eraseCredentials()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSalt()
|
|
|
|
{
|
|
|
|
return $this->password;
|
|
|
|
}
|
|
|
|
}
|