src/Entity/Admin.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\Site\Domain;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\AdminRepository")
  9.  * @ORM\Table(indexes={
  10.  *     @ORM\Index(columns={"username"}),
  11.  *     @ORM\Index(columns={"domain"}),
  12.  *     })
  13.  */
  14. class Admin
  15. {
  16.     use Traits\Created;
  17.     use Traits\ToArray;
  18.     /**
  19.      * @ORM\Id()
  20.      * @ORM\GeneratedValue()
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="encrypted_string", length=30)
  26.      */
  27.     private $username;
  28.     /**
  29.      * @ORM\Column(type="string", length=32)
  30.      */
  31.     private $password;
  32.     /**
  33.      * @ORM\Column(type="string", length=15)
  34.      */
  35.     private $status 'active';
  36.     /**
  37.      * @ORM\Column(type="encrypted_string", length=50)
  38.      */
  39.     private $email;
  40.     /**
  41.      * @ORM\Column(type="encrypted_string", length=50)
  42.      */
  43.     private $phone;
  44.     /**
  45.      * @ORM\Column(type="encrypted_string", length=50)
  46.      */
  47.     private $skype;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity="App\Entity\Role", inversedBy="admins")
  50.      */
  51.     private $role;
  52.     /**
  53.      * @ORM\Column(type="enum", options={"values": "site_enum", "default": null}, nullable=true)
  54.      */
  55.     protected $domain null;
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getUsername()
  61.     {
  62.         return $this->username;
  63.     }
  64.     public function setUsername($username): self
  65.     {
  66.         $this->username $username;
  67.         return $this;
  68.     }
  69.     public function getPassword(): ?string
  70.     {
  71.         return $this->password;
  72.     }
  73.     public function setPassword(string $password): self
  74.     {
  75.         $this->password $password;
  76.         return $this;
  77.     }
  78.     public function getStatus(): ?string
  79.     {
  80.         return $this->status;
  81.     }
  82.     public function setStatus(string $status): self
  83.     {
  84.         $this->status $status;
  85.         return $this;
  86.     }
  87.     public function getEmail()
  88.     {
  89.         return $this->email;
  90.     }
  91.     public function setEmail($email): self
  92.     {
  93.         $this->email $email;
  94.         return $this;
  95.     }
  96.     public function getPhone()
  97.     {
  98.         return $this->phone;
  99.     }
  100.     public function setPhone($phone): self
  101.     {
  102.         $this->phone $phone;
  103.         return $this;
  104.     }
  105.     public function getSkype()
  106.     {
  107.         return $this->skype;
  108.     }
  109.     public function setSkype($skype): self
  110.     {
  111.         $this->skype $skype;
  112.         return $this;
  113.     }
  114.     public function getRoles()
  115.     {
  116.         return ['ROLE_ADMIN'];
  117.     }
  118.     public function getRole(): ?Role
  119.     {
  120.         return $this->role;
  121.     }
  122.     public function setRole(?Role $role): self
  123.     {
  124.         $this->role $role;
  125.         return $this;
  126.     }
  127.     public function getDomain()
  128.     {
  129.         return $this->domain;
  130.     }
  131.     public function setDomain($domain): self
  132.     {
  133.         $this->domain $domain;
  134.         return $this;
  135.     }
  136. }