src/Entity/Backendmanager.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BackendmanagerRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Serializable;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. /**
  8.  * @ORM\Entity(repositoryClass=BackendmanagerRepository::class)
  9.  */
  10. class Backendmanager implements UserInterfaceSerializable
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $username;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $password;
  26.     /**
  27.      * @ORM\Column(type="string", length=6, nullable=true)
  28.      */
  29.     private $allow;
  30.     /**
  31.      * @ORM\Column(type="datetime")
  32.      */
  33.     private $created_at;
  34.     public function __construct()
  35.     {
  36.         $this->created_at = new \DateTime();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getUsername(): ?string
  43.     {
  44.         return $this->username;
  45.     }
  46.     public function setUsername(string $username): self
  47.     {
  48.         $this->username $username;
  49.         return $this;
  50.     }
  51.     public function getPassword(): ?string
  52.     {
  53.         return $this->password;
  54.     }
  55.     public function setPassword(string $password): self
  56.     {
  57.         $this->password $password;
  58.         return $this;
  59.     }
  60.     public function getAllow(): ?string
  61.     {
  62.         return $this->allow;
  63.     }
  64.     public function setAllow(?string $allow): self
  65.     {
  66.         $this->allow $allow;
  67.         return $this;
  68.     }
  69.     public function getCreatedAt(): ?\DateTimeInterface
  70.     {
  71.         return $this->created_at;
  72.     }
  73.     public function setCreatedAt(\DateTimeInterface $created_at): self
  74.     {
  75.         $this->created_at $created_at;
  76.         return $this;
  77.     }
  78.     public function getRoles()
  79.     {
  80.         return ['ROLE_ADMIN'];
  81.     }
  82.     public function getSalt()
  83.     {
  84.         return null;
  85.     }
  86.     public function eraseCredentials()
  87.     {
  88.     }
  89.     public function serialize()
  90.     {
  91.         return serialize([
  92.             $this->id,
  93.             $this->username,
  94.             $this->password
  95.         ]);
  96.     }
  97.     public function unserialize($serialise)
  98.     {
  99.         list(
  100.             $this->id,
  101.             $this->username,
  102.             $this->password
  103.         ) = unserialize($serialise, ['allowed_classes' => false]);
  104.     }
  105.     public function getUserIdentifier(): ?string
  106.     {
  107.         return $this->getUsername();
  108.     }
  109. }