src/Domain/Entity/Entidad.php line 10

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