src/Entity/AcessoCliente.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\AcessoClienteRepository")
  9.  * @UniqueEntity("email")
  10.  */
  11. class AcessoCliente
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $email;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $senha;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $token;
  31.     /**
  32.      * @ORM\Column(type="date", nullable=true)
  33.      */
  34.     private $dataInicial;
  35.     /**
  36.      * @ORM\Column(type="date", nullable=true)
  37.      */
  38.     private $dataFinal;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity="App\Entity\Cliente")
  41.      * @ORM\JoinColumn(nullable=false)
  42.      */
  43.     private $cliente;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="App\Entity\OrdemDeServico", mappedBy="acessoCliente")
  46.      */
  47.     private $os_acessos;
  48.     public function __construct()
  49.     {
  50.         $this->os_acessos = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getEmail(): ?string
  57.     {
  58.         return $this->email;
  59.     }
  60.     public function setEmail(string $email): self
  61.     {
  62.         $this->email $email;
  63.         return $this;
  64.     }
  65.     public function getSenha(): ?string
  66.     {
  67.         return $this->senha;
  68.     }
  69.     public function setSenha(string $senha): self
  70.     {
  71.         $this->senha $senha;
  72.         return $this;
  73.     }
  74.     public function getToken(): ?string
  75.     {
  76.         return $this->token;
  77.     }
  78.     public function setToken(string $token): self
  79.     {
  80.         $this->token $token;
  81.         return $this;
  82.     }
  83.     public function getDataInicial(): ?\DateTimeInterface
  84.     {
  85.         return $this->dataInicial;
  86.     }
  87.     public function setDataInicial(?\DateTimeInterface $dataInicial): self
  88.     {
  89.         $this->dataInicial $dataInicial;
  90.         return $this;
  91.     }
  92.     public function getDataFinal(): ?\DateTimeInterface
  93.     {
  94.         return $this->dataFinal;
  95.     }
  96.     public function setDataFinal(?\DateTimeInterface $dataFinal): self
  97.     {
  98.         $this->dataFinal $dataFinal;
  99.         return $this;
  100.     }
  101.     public function getCliente(): ?Cliente
  102.     {
  103.         return $this->cliente;
  104.     }
  105.     public function setCliente(?Cliente $cliente): self
  106.     {
  107.         $this->cliente $cliente;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection|OrdemDeServico[]
  112.      */
  113.     public function getOsAcessos(): Collection
  114.     {
  115.         return $this->os_acessos;
  116.     }
  117.     public function addOsAcesso(OrdemDeServico $osAcesso): self
  118.     {
  119.         if (!$this->os_acessos->contains($osAcesso)) {
  120.             $this->os_acessos[] = $osAcesso;
  121.             $osAcesso->setAcessoCliente($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeOsAcesso(OrdemDeServico $osAcesso): self
  126.     {
  127.         if ($this->os_acessos->contains($osAcesso)) {
  128.             $this->os_acessos->removeElement($osAcesso);
  129.             // set the owning side to null (unless already changed)
  130.             if ($osAcesso->getAcessoCliente() === $this) {
  131.                 $osAcesso->setAcessoCliente(null);
  132.             }
  133.         }
  134.         return $this;
  135.     }
  136. }