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="abistuff_users")
- * @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
- */
- class User implements UserInterface, \Serializable
- {
- /**
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=40, unique=true)
- */
- private $username;
- /**
- * @ORM\Column(type="string", length=64)
- */
- private $password;
- /**
- * @ORM\Column(type="string", length=40, unique=true)
- */
- private $displayname;
- /**
- * @ORM\Column(type="boolean", name="is_admin")
- */
- private $isAdmin;
- /**
- * @ORM\Column(type="boolean", name="is_active")
- */
- private $isActive;
- public function __construct()
- {
- $this->isActive = true;
- }
- public function getSalt()
- {
- //Kann ruhig null sein, da BCRYPT verwendet wird, und der BCRYPT-Algorithmus das selber macht
- return null;
- }
- public function getRoles()
- {
- return array('ROLE_USER');
- }
- public function eraseCredentials(){ }
- public function serialize()
- {
- return serialize(array(
- $this->id, $this->username, $this->password
- ));
- }
- public function unserialize($serialized)
- {
- list($this->id, $this->username, $this->password) = $this->unserialize($serialized);
- }
- //<editor-fold desc="Getters und Setters">
- public function getUsername()
- {
- return $this->username;
- }
- public function getPassword()
- {
- return $this->password;
- }
- public function getId()
- {
- return $this->id;
- }
- public function getDisplayname()
- {
- return $this->displayname;
- }
- public function isActive()
- {
- return $this->isActive;
- }
- public function isAdmin()
- {
- return $this->isAdmin;
- }
- /**
- * @param mixed $username
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
- /**
- * @param mixed $password
- */
- public function setPassword($password)
- {
- $this->password = $password;
- }
- /**
- * @param mixed $displayname
- */
- public function setDisplayname($displayname)
- {
- $this->displayname = $displayname;
- }
- /**
- * @param mixed $isAdmin
- */
- public function setIsAdmin($isAdmin)
- {
- $this->isAdmin = $isAdmin;
- }
- /**
- * @param mixed $isActive
- */
- public function setIsActive($isActive)
- {
- $this->isActive = $isActive;
- }
- //</editor-fold>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement