<?php
namespace App\Entity;
use App\Enum\Site\Domain;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\AdminRepository")
* @ORM\Table(indexes={
* @ORM\Index(columns={"username"}),
* @ORM\Index(columns={"domain"}),
* })
*/
class Admin
{
use Traits\Created;
use Traits\ToArray;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="encrypted_string", length=30)
*/
private $username;
/**
* @ORM\Column(type="string", length=32)
*/
private $password;
/**
* @ORM\Column(type="string", length=15)
*/
private $status = 'active';
/**
* @ORM\Column(type="encrypted_string", length=50)
*/
private $email;
/**
* @ORM\Column(type="encrypted_string", length=50)
*/
private $phone;
/**
* @ORM\Column(type="encrypted_string", length=50)
*/
private $skype;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Role", inversedBy="admins")
*/
private $role;
/**
* @ORM\Column(type="enum", options={"values": "site_enum", "default": null}, nullable=true)
*/
protected $domain = null;
public function getId(): ?int
{
return $this->id;
}
public function getUsername()
{
return $this->username;
}
public function setUsername($username): self
{
$this->username = $username;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email): self
{
$this->email = $email;
return $this;
}
public function getPhone()
{
return $this->phone;
}
public function setPhone($phone): self
{
$this->phone = $phone;
return $this;
}
public function getSkype()
{
return $this->skype;
}
public function setSkype($skype): self
{
$this->skype = $skype;
return $this;
}
public function getRoles()
{
return ['ROLE_ADMIN'];
}
public function getRole(): ?Role
{
return $this->role;
}
public function setRole(?Role $role): self
{
$this->role = $role;
return $this;
}
public function getDomain()
{
return $this->domain;
}
public function setDomain($domain): self
{
$this->domain = $domain;
return $this;
}
}