src/Domain/Entity/Metadata.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Domain\Interfaces\MetadataInterface;
  4. use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
  5. use DateTimeInterface;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Symfony\Component\Uid\Uuid;
  10. class Metadata implements EntityInterfaceMetadataInterface
  11. {
  12.     private ?Uuid $id null;
  13.     private ?string $key null;
  14.     private ?string $nombre null;
  15.     private ?string $descripcion null;
  16.     private $schema null;
  17.     private ?string $css null;
  18.     private ?string $js null;
  19.     private ?string $translations null;
  20.     private ?string $translationDomain null;
  21.     private ?DateTimeInterface $createdAt null;
  22.     private ?DateTimeInterface $updatedAt null;
  23.     private ?DateTimeInterface $deletedAt null;
  24.     private Collection $handlers;
  25.     public function __construct()
  26.     {
  27.         $this->handlers = new ArrayCollection();
  28.     }
  29.     public function __toString(): string
  30.     {
  31.         return $this->getNombre()??$this->getKey()??'';
  32.     }
  33.     public function getKey(): ?string
  34.     {
  35.         return $this->key;
  36.     }
  37.     public function setKey(?string $key): static
  38.     {
  39.         $this->key $key;
  40.         return $this;
  41.     }
  42.     public function getNombre(): ?string
  43.     {
  44.         return $this->nombre;
  45.     }
  46.     public function setNombre(?string $nombre): static
  47.     {
  48.         $this->nombre $nombre;
  49.         return $this;
  50.     }
  51.     public function getDescripcion(): ?string
  52.     {
  53.         return $this->descripcion;
  54.     }
  55.     public function setDescripcion(?string $descripcion): static
  56.     {
  57.         $this->descripcion $descripcion;
  58.         return $this;
  59.     }
  60.     public function getSchema(): ?string
  61.     {
  62.         return $this->schema;
  63.     }
  64.     public function setSchema(?string $schema): static
  65.     {
  66.         $this->schema $schema;
  67.         return $this;
  68.     }
  69.     public function getCss(): ?string
  70.     {
  71.         return $this->css;
  72.     }
  73.     public function setCss(?string $css): static
  74.     {
  75.         $this->css $css;
  76.         return $this;
  77.     }
  78.     public function getJs(): ?string
  79.     {
  80.         return $this->js;
  81.     }
  82.     public function setJs(?string $js): static
  83.     {
  84.         $this->js $js;
  85.         return $this;
  86.     }
  87.     public function getTranslations(): ?string
  88.     {
  89.         return $this->translations;
  90.     }
  91.     public function setTranslations(?string $translations): static
  92.     {
  93.         $this->translations $translations;
  94.         return $this;
  95.     }
  96.     public function getTranslationDomain(): ?string
  97.     {
  98.         return $this->translationDomain;
  99.     }
  100.     public function setTranslationDomain(?string $translationDomain): static
  101.     {
  102.         $this->translationDomain $translationDomain;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->createdAt;
  108.     }
  109.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  110.     {
  111.         $this->createdAt $createdAt;
  112.         return $this;
  113.     }
  114.     public function getUpdatedAt(): ?\DateTimeInterface
  115.     {
  116.         return $this->updatedAt;
  117.     }
  118.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  119.     {
  120.         $this->updatedAt $updatedAt;
  121.         return $this;
  122.     }
  123.     public function getDeletedAt(): ?\DateTimeInterface
  124.     {
  125.         return $this->deletedAt;
  126.     }
  127.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  128.     {
  129.         $this->deletedAt $deletedAt;
  130.         return $this;
  131.     }
  132.     public function getId(): ?Uuid
  133.     {
  134.         return $this->id;
  135.     }
  136.     /**
  137.      * @return Collection<int, Handler>
  138.      */
  139.     public function getHandlers(): Collection
  140.     {
  141.         return $this->handlers;
  142.     }
  143.     public function addHandler(Handler $handler): static
  144.     {
  145.         if (!$this->handlers->contains($handler)) {
  146.             $this->handlers->add($handler);
  147.             $handler->setMetadata($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeHandler(Handler $handler): static
  152.     {
  153.         if ($this->handlers->removeElement($handler)) {
  154.             // set the owning side to null (unless already changed)
  155.             if ($handler->getMetadata() === $this) {
  156.                 $handler->setMetadata(null);
  157.             }
  158.         }
  159.         return $this;
  160.     }
  161.     public function getForm(): ?string
  162.     {
  163.         return null;
  164.     }
  165.     public function setForm(?string $form): static
  166.     {
  167.         return $this;
  168.     }
  169.     public function getMetadata(): ?self
  170.     {
  171.         return null;
  172.     }
  173.     public function setMetadata(?MetadataInterface $metadata): static
  174.     {
  175.         return $this;
  176.     }
  177. }