Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Security\Core\User\UserInterface;
- /**
- * @ORM\Table{name="app_users")
- * @ORM\Entity(repositoryClass="AppBundle\Entity\UserRepository")
- */
- class User implements UserInterface, \Serializable {
- /**
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=25, unique=true)
- */
- private $username;
- /**
- * @ORM\Column(type="string", length=64)
- */
- private $password;
- /**
- * @ORM\Column(type="string", length=60, unique=true)
- */
- private $email;
- /**
- * @ORM\Column(name="is_active", type="boolean")
- */
- private $isActive;
- /**
- * @ORM\Column(type="string", length=30, unique=true)
- */
- private $nick;
- /**
- * @ORM\Column(name="create_date", type="date")
- */
- private $createDate;
- public function __construct() {
- $this->isActive = true;
- }
- public function getSalt() {
- return null;
- }
- public function getRoles() {
- return array('ROLE_USER');
- }
- public function getPassword() {
- return $this->password;
- }
- public function getUserName() {
- return $this->username;
- }
- public function eraseCredentials()
- {
- }
- /** @see \Serializable::serialize() */
- public function serialize()
- {
- return serialize(array(
- $this->id,
- $this->username,
- $this->password,
- // see section on salt below
- // $this->salt,
- ));
- }
- /** @see \Serializable::unserialize() */
- public function unserialize($serialized)
- {
- list (
- $this->id,
- $this->username,
- $this->password,
- // see section on salt below
- // $this->salt
- ) = unserialize($serialized);
- }
- /**
- * 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;
- }
- /**
- * Set password
- *
- * @param string $password
- *
- * @return User
- */
- public function setPassword($password)
- {
- $this->password = $password;
- return $this;
- }
- /**
- * 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 isActive
- *
- * @param boolean $isActive
- *
- * @return User
- */
- public function setIsActive($isActive)
- {
- $this->isActive = $isActive;
- return $this;
- }
- /**
- * Get isActive
- *
- * @return boolean
- */
- public function getIsActive()
- {
- return $this->isActive;
- }
- /**
- * Set nick
- *
- * @param string $nick
- *
- * @return User
- */
- public function setNick($nick)
- {
- $this->nick = $nick;
- return $this;
- }
- /**
- * Get nick
- *
- * @return string
- */
- public function getNick()
- {
- return $this->nick;
- }
- /**
- * Set createDate
- *
- * @param \DateTime $createDate
- *
- * @return User
- */
- public function setCreateDate($createDate)
- {
- $this->createDate = $createDate;
- return $this;
- }
- /**
- * Get createDate
- *
- * @return \DateTime
- */
- public function getCreateDate()
- {
- return $this->createDate;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement