src/Domain/Entity/Calendario.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Uid\Uuid;
  9. class Calendario implements EntityInterface
  10. {
  11.     private ?int $anyo null;
  12.     private ?bool $active null;
  13.     private ?Uuid $id null;
  14.     private Collection $festivos;
  15.     private ?Provincia $provincia null;
  16.     private ?Entidad $entidad null;
  17.     private ?\DateTimeInterface $createdAt null;
  18.     private ?\DateTimeInterface $updatedAt null;
  19.     private ?\DateTimeInterface $deletedAt null;
  20.     public function __construct()
  21.     {
  22.         $this->festivos = new ArrayCollection();
  23.     }
  24.     public function __toString(): string
  25.     {
  26.         return trim($this->getAnyo() . ' ' $this->getProvincia()) ?? '---';
  27.     }
  28.     public function getAnyo(): ?int
  29.     {
  30.         return $this->anyo;
  31.     }
  32.     public function setAnyo(?int $anyo): static
  33.     {
  34.         $this->anyo $anyo;
  35.         return $this;
  36.     }
  37.     public function isActive(): ?bool
  38.     {
  39.         return $this->active;
  40.     }
  41.     public function setActive(?bool $active): static
  42.     {
  43.         $this->active $active;
  44.         return $this;
  45.     }
  46.     public function getId(): ?Uuid
  47.     {
  48.         return $this->id;
  49.     }
  50.     /**
  51.      * @return Collection<int, Festivo>
  52.      */
  53.     public function getFestivos(): Collection
  54.     {
  55.         return $this->festivos;
  56.     }
  57.     public function addFestivo(Festivo $festivo): static
  58.     {
  59.         if (!$this->festivos->contains($festivo)) {
  60.             $this->festivos->add($festivo);
  61.             $festivo->setCalendario($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeFestivo(Festivo $festivo): static
  66.     {
  67.         if ($this->festivos->removeElement($festivo)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($festivo->getCalendario() === $this) {
  70.                 $festivo->setCalendario(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75.     public function getProvincia(): ?Provincia
  76.     {
  77.         return $this->provincia;
  78.     }
  79.     public function setProvincia(?Provincia $provincia): static
  80.     {
  81.         $this->provincia $provincia;
  82.         return $this;
  83.     }
  84.     public function getEntidad(): ?Entidad
  85.     {
  86.         return $this->entidad;
  87.     }
  88.     public function setEntidad(?Entidad $entidad): static
  89.     {
  90.         $this->entidad $entidad;
  91.         return $this;
  92.     }
  93.     public function getCreatedAt(): ?\DateTimeInterface
  94.     {
  95.         return $this->createdAt;
  96.     }
  97.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  98.     {
  99.         $this->createdAt $createdAt;
  100.         return $this;
  101.     }
  102.     public function getUpdatedAt(): ?\DateTimeInterface
  103.     {
  104.         return $this->updatedAt;
  105.     }
  106.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  107.     {
  108.         $this->updatedAt $updatedAt;
  109.         return $this;
  110.     }
  111.     public function getDeletedAt(): ?\DateTimeInterface
  112.     {
  113.         return $this->deletedAt;
  114.     }
  115.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  116.     {
  117.         $this->deletedAt $deletedAt;
  118.         return $this;
  119.     }
  120. }