src/Domain/Entity/Entidad.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use DateTimeInterface;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Symfony\Component\Uid\Uuid;
  8. class Entidad
  9. {
  10.     private ?Uuid $id null;
  11.     private ?string $nombre null;
  12.     private ?string $dni;
  13.     private ?string $codigo null;
  14.     private ?DateTimeInterface $createdAt null;
  15.     private ?DateTimeInterface $updatedAt null;
  16.     private ?DateTimeInterface $deletedAt null;
  17.     private Collection $expedientes;
  18.     private Collection $estados;
  19.     private Collection $metadataExpedientes;
  20.     private Collection $sonataUserUsers;
  21.     private Collection $calendarios;
  22.     private Collection $documentacions;
  23.     private Collection $intervinientes;
  24.     private Collection $sedes;
  25.     private Collection $metadataCustomRegistros;
  26.     private Collection $metadataExpedientesEnabled;
  27.     private Collection $metadataCustomRegistrosEnabled;
  28.     public function __construct()
  29.     {
  30.         $this->expedientes = new ArrayCollection();
  31.         $this->estados = new ArrayCollection();
  32.         $this->metadataExpedientes = new ArrayCollection();
  33.         $this->sonataUserUsers = new ArrayCollection();
  34.         $this->calendarios = new ArrayCollection();
  35.         $this->documentacions = new ArrayCollection();
  36.         $this->intervinientes = new ArrayCollection();
  37.         $this->sedes = new ArrayCollection();
  38.         $this->metadataCustomRegistros = new ArrayCollection();
  39.         $this->metadataExpedientesEnabled = new ArrayCollection();
  40.         $this->metadataCustomRegistrosEnabled = new ArrayCollection();
  41.     }
  42.     public function __toString(): string
  43.     {
  44.         return $this->getNombre()??'Entidad Sin Definir';
  45.     }
  46.     public function getCodigo(): ?string
  47.     {
  48.         return $this->codigo;
  49.     }
  50.     public function setCodigo(?string $codigo): static
  51.     {
  52.         $this->codigo $codigo;
  53.         return $this;
  54.     }
  55.     public function getNombre(): ?string
  56.     {
  57.         return $this->nombre;
  58.     }
  59.     public function setNombre(?string $nombre): static
  60.     {
  61.         $this->nombre $nombre;
  62.         return $this;
  63.     }
  64.     public function getCreatedAt(): ?\DateTimeInterface
  65.     {
  66.         return $this->createdAt;
  67.     }
  68.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  69.     {
  70.         $this->createdAt $createdAt;
  71.         return $this;
  72.     }
  73.     public function getUpdatedAt(): ?\DateTimeInterface
  74.     {
  75.         return $this->updatedAt;
  76.     }
  77.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  78.     {
  79.         $this->updatedAt $updatedAt;
  80.         return $this;
  81.     }
  82.     public function getDeletedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->deletedAt;
  85.     }
  86.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  87.     {
  88.         $this->deletedAt $deletedAt;
  89.         return $this;
  90.     }
  91.     public function getId(): ?Uuid
  92.     {
  93.         return $this->id;
  94.     }
  95.     /**
  96.      * @return Collection<int, Expediente>
  97.      */
  98.     public function getExpedientes(): Collection
  99.     {
  100.         return $this->expedientes;
  101.     }
  102.     public function addExpediente(Expediente $expediente): static
  103.     {
  104.         if (!$this->expedientes->contains($expediente)) {
  105.             $this->expedientes->add($expediente);
  106.             $expediente->setEntidad($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeExpediente(Expediente $expediente): static
  111.     {
  112.         if ($this->expedientes->removeElement($expediente)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($expediente->getEntidad() === $this) {
  115.                 $expediente->setEntidad(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, Estado>
  122.      */
  123.     public function getEstados(): Collection
  124.     {
  125.         return $this->estados;
  126.     }
  127.     public function addEstado(Estado $estado): static
  128.     {
  129.         if (!$this->estados->contains($estado)) {
  130.             $this->estados->add($estado);
  131.             $estado->setEntidad($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeEstado(Estado $estado): static
  136.     {
  137.         if ($this->estados->removeElement($estado)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($estado->getEntidad() === $this) {
  140.                 $estado->setEntidad(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection<int, MetadataExpediente>
  147.      */
  148.     public function getMetadataExpedientes(): Collection
  149.     {
  150.         return $this->metadataExpedientes;
  151.     }
  152.     public function addMetadataExpediente(MetadataExpediente $metadataExpediente): static
  153.     {
  154.         if (!$this->metadataExpedientes->contains($metadataExpediente)) {
  155.             $this->metadataExpedientes->add($metadataExpediente);
  156.             $metadataExpediente->setEntidad($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeMetadataExpediente(MetadataExpediente $metadataExpediente): static
  161.     {
  162.         if ($this->metadataExpedientes->removeElement($metadataExpediente)) {
  163.             // set the owning side to null (unless already changed)
  164.             if ($metadataExpediente->getEntidad() === $this) {
  165.                 $metadataExpediente->setEntidad(null);
  166.             }
  167.         }
  168.         return $this;
  169.     }
  170.     /**
  171.      * @return Collection<int, SonataUserUser>
  172.      */
  173.     public function getSonataUserUsers(): Collection
  174.     {
  175.         return $this->sonataUserUsers;
  176.     }
  177.     public function addSonataUserUser(SonataUserUser $sonataUserUser): static
  178.     {
  179.         if (!$this->sonataUserUsers->contains($sonataUserUser)) {
  180.             $this->sonataUserUsers->add($sonataUserUser);
  181.             $sonataUserUser->setEntidad($this);
  182.         }
  183.         return $this;
  184.     }
  185.     public function removeSonataUserUser(SonataUserUser $sonataUserUser): static
  186.     {
  187.         if ($this->sonataUserUsers->removeElement($sonataUserUser)) {
  188.             // set the owning side to null (unless already changed)
  189.             if ($sonataUserUser->getEntidad() === $this) {
  190.                 $sonataUserUser->setEntidad(null);
  191.             }
  192.         }
  193.         return $this;
  194.     }
  195.     /**
  196.      * @return Collection<int, Calendario>
  197.      */
  198.     public function getCalendarios(): Collection
  199.     {
  200.         return $this->calendarios;
  201.     }
  202.     public function addCalendario(Calendario $calendario): static
  203.     {
  204.         if (!$this->calendarios->contains($calendario)) {
  205.             $this->calendarios->add($calendario);
  206.             $calendario->setEntidad($this);
  207.         }
  208.         return $this;
  209.     }
  210.     public function removeCalendario(Calendario $calendario): static
  211.     {
  212.         if ($this->calendarios->removeElement($calendario)) {
  213.             // set the owning side to null (unless already changed)
  214.             if ($calendario->getEntidad() === $this) {
  215.                 $calendario->setEntidad(null);
  216.             }
  217.         }
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return Collection<int, Documentacion>
  222.      */
  223.     public function getDocumentacions(): Collection
  224.     {
  225.         return $this->documentacions;
  226.     }
  227.     public function addDocumentacion(Documentacion $documentacion): static
  228.     {
  229.         if (!$this->documentacions->contains($documentacion)) {
  230.             $this->documentacions->add($documentacion);
  231.             $documentacion->setEntidad($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeDocumentacion(Documentacion $documentacion): static
  236.     {
  237.         if ($this->documentacions->removeElement($documentacion)) {
  238.             // set the owning side to null (unless already changed)
  239.             if ($documentacion->getEntidad() === $this) {
  240.                 $documentacion->setEntidad(null);
  241.             }
  242.         }
  243.         return $this;
  244.     }
  245.     /**
  246.      * @return Collection<int, Interviniente>
  247.      */
  248.     public function getIntervinientes(): Collection
  249.     {
  250.         return $this->intervinientes;
  251.     }
  252.     public function addInterviniente(Interviniente $interviniente): static
  253.     {
  254.         if (!$this->intervinientes->contains($interviniente)) {
  255.             $this->intervinientes->add($interviniente);
  256.             $interviniente->setEntidad($this);
  257.         }
  258.         return $this;
  259.     }
  260.     public function removeInterviniente(Interviniente $interviniente): static
  261.     {
  262.         if ($this->intervinientes->removeElement($interviniente)) {
  263.             // set the owning side to null (unless already changed)
  264.             if ($interviniente->getEntidad() === $this) {
  265.                 $interviniente->setEntidad(null);
  266.             }
  267.         }
  268.         return $this;
  269.     }
  270.     /**
  271.      * @return Collection<int, Sede>
  272.      */
  273.     public function getSedes(): Collection
  274.     {
  275.         return $this->sedes;
  276.     }
  277.     public function addSede(Sede $sede): static
  278.     {
  279.         if (!$this->sedes->contains($sede)) {
  280.             $this->sedes->add($sede);
  281.             $sede->setEntidad($this);
  282.         }
  283.         return $this;
  284.     }
  285.     public function removeSede(Sede $sede): static
  286.     {
  287.         if ($this->sedes->removeElement($sede)) {
  288.             // set the owning side to null (unless already changed)
  289.             if ($sede->getEntidad() === $this) {
  290.                 $sede->setEntidad(null);
  291.             }
  292.         }
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return Collection<int, MetadataCustomRegistro>
  297.      */
  298.     public function getMetadataCustomRegistros(): Collection
  299.     {
  300.         return $this->metadataCustomRegistros;
  301.     }
  302.     public function addMetadataCustomRegistro(MetadataCustomRegistro $metadataCustomRegistro): static
  303.     {
  304.         if (!$this->metadataCustomRegistros->contains($metadataCustomRegistro)) {
  305.             $this->metadataCustomRegistros->add($metadataCustomRegistro);
  306.             $metadataCustomRegistro->setEntidad($this);
  307.         }
  308.         return $this;
  309.     }
  310.     public function removeMetadataCustomRegistro(MetadataCustomRegistro $metadataCustomRegistro): static
  311.     {
  312.         if ($this->metadataCustomRegistros->removeElement($metadataCustomRegistro)) {
  313.             // set the owning side to null (unless already changed)
  314.             if ($metadataCustomRegistro->getEntidad() === $this) {
  315.                 $metadataCustomRegistro->setEntidad(null);
  316.             }
  317.         }
  318.         return $this;
  319.     }
  320.     /**
  321.      * @return Collection<int, MetadataExpediente>
  322.      */
  323.     public function getMetadataExpedientesEnabled(): Collection
  324.     {
  325.         return $this->metadataExpedientesEnabled;
  326.     }
  327.     public function addMetadataExpedientesEnabled(MetadataExpediente $metadataExpedientesEnabled): static
  328.     {
  329.         if (!$this->metadataExpedientesEnabled->contains($metadataExpedientesEnabled)) {
  330.             $this->metadataExpedientesEnabled->add($metadataExpedientesEnabled);
  331.         }
  332.         return $this;
  333.     }
  334.     public function removeMetadataExpedientesEnabled(MetadataExpediente $metadataExpedientesEnabled): static
  335.     {
  336.         $this->metadataExpedientesEnabled->removeElement($metadataExpedientesEnabled);
  337.         return $this;
  338.     }
  339.     /**
  340.      * @return Collection<int, MetadataCustomRegistro>
  341.      */
  342.     public function getMetadataCustomRegistrosEnabled(): Collection
  343.     {
  344.         return $this->metadataCustomRegistrosEnabled;
  345.     }
  346.     public function addMetadataCustomRegistrosEnabled(MetadataCustomRegistro $metadataCustomRegistrosEnabled): static
  347.     {
  348.         if (!$this->metadataCustomRegistrosEnabled->contains($metadataCustomRegistrosEnabled)) {
  349.             $this->metadataCustomRegistrosEnabled->add($metadataCustomRegistrosEnabled);
  350.         }
  351.         return $this;
  352.     }
  353.     public function removeMetadataCustomRegistrosEnabled(MetadataCustomRegistro $metadataCustomRegistrosEnabled): static
  354.     {
  355.         $this->metadataCustomRegistrosEnabled->removeElement($metadataCustomRegistrosEnabled);
  356.         return $this;
  357.     }
  358.     public function getDni()
  359.     {
  360.         return $this->dni;
  361.     }
  362.     public function setDni($dni): static
  363.     {
  364.         $this->dni $dni;
  365.         return $this;
  366.     }
  367. }