src/Entity/RegistroWhatsapp.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegistroWhatsappRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=RegistroWhatsappRepository::class)
  9.  */
  10. class RegistroWhatsapp
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=100)
  20.      */
  21.     private $fromId;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $fechaCreacion;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $fechaUltimaActualizacion;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $urlReserva;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $estado;
  38.     const ESTADO_ADMINISTRACION "administracion";
  39.     const ESTADO_SOLICITADA "solicitada";
  40.     const ESTADO_CONSULTA "consulta";
  41.     const ESTADO_STOCK "stock";
  42.     const ESTADO_RESERVA "reserva";
  43.     const ESTADO_CANCELADA "cancelada";
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=RegistroWhatsappNumero::class, mappedBy="registroWhatsapp", orphanRemoval=true)
  46.      */
  47.     private $numeros;
  48.     public function __construct()
  49.     {
  50.         $this->numeros = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getFromId(): ?string
  57.     {
  58.         return $this->fromId;
  59.     }
  60.     public function setFromId(string $fromId): self
  61.     {
  62.         $this->fromId $fromId;
  63.         return $this;
  64.     }
  65.     public function getFechaCreacion(): ?\DateTimeInterface
  66.     {
  67.         return $this->fechaCreacion;
  68.     }
  69.     public function setFechaCreacion(\DateTimeInterface $fechaCreacion): self
  70.     {
  71.         $this->fechaCreacion $fechaCreacion;
  72.         return $this;
  73.     }
  74.     public function getFechaUltimaActualizacion(): ?\DateTimeInterface
  75.     {
  76.         return $this->fechaUltimaActualizacion;
  77.     }
  78.     public function setFechaUltimaActualizacion(\DateTimeInterface $fechaUltimaActualizacion): self
  79.     {
  80.         $this->fechaUltimaActualizacion $fechaUltimaActualizacion;
  81.         return $this;
  82.     }
  83.     public function getUrlReserva(): ?string
  84.     {
  85.         return $this->urlReserva;
  86.     }
  87.     public function setUrlReserva(?string $urlReserva): self
  88.     {
  89.         $this->urlReserva $urlReserva;
  90.         return $this;
  91.     }
  92.     public function getEstado(): ?string
  93.     {
  94.         return $this->estado;
  95.     }
  96.     public function setEstado(string $estado): self
  97.     {
  98.         $this->estado $estado;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return Collection<int, RegistroWhatsappNumero>
  103.      */
  104.     public function getNumeros(): Collection
  105.     {
  106.         return $this->numeros;
  107.     }
  108.     public function addNumero(RegistroWhatsappNumero $numero): self
  109.     {
  110.         if (!$this->numeros->contains($numero)) {
  111.             $this->numeros[] = $numero;
  112.             $numero->setRegistroWhatsapp($this);
  113.         }
  114.         return $this;
  115.     }
  116.     public function removeNumero(RegistroWhatsappNumero $numero): self
  117.     {
  118.         if ($this->numeros->removeElement($numero)) {
  119.             // set the owning side to null (unless already changed)
  120.             if ($numero->getRegistroWhatsapp() === $this) {
  121.                 $numero->setRegistroWhatsapp(null);
  122.             }
  123.         }
  124.         return $this;
  125.     }
  126. }