src/Domain/Entity/CentroTrabajo.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use DateTime;
  4. use DateTimeInterface;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Uid\Uuid;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. class CentroTrabajo
  10. {
  11.     /**
  12.      * @var string|null
  13.      * @Assert\NotBlank(message="not_blank")
  14.      */
  15.     private ?string $nombre null;
  16.     private ?Uuid $id null;
  17.     /**
  18.      * @var string|null
  19.      * @Assert\NotBlank(message="not_blank")
  20.      */
  21.     private ?Empresa $empresa null;
  22.     private ?DateTimeInterface $createdAt null;
  23.     private ?DateTimeInterface $updatedAt null;
  24.     private ?DateTimeInterface $deletedAt null;
  25.     public function __clone(): void
  26.     {
  27.         $this->id null;
  28.         $this->setCreatedAt(new DateTime('now'));
  29.         $this->setUpdatedAt(new DateTime('now'));
  30.     }
  31.     public function __toString(): string
  32.     {
  33.         return $this->getNombre()??'---';
  34.     }
  35.     public function getNombre(): ?string
  36.     {
  37.         return $this->nombre;
  38.     }
  39.     public function setNombre(?string $nombre): static
  40.     {
  41.         $this->nombre $nombre;
  42.         return $this;
  43.     }
  44.     public function getId(): ?Uuid
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getEmpresa(): ?Empresa
  49.     {
  50.         return $this->empresa;
  51.     }
  52.     public function setEmpresa(?Empresa $empresa): static
  53.     {
  54.         $this->empresa $empresa;
  55.         return $this;
  56.     }
  57.     public function getCreatedAt(): ?DateTimeInterface
  58.     {
  59.         return $this->createdAt;
  60.     }
  61.     public function setCreatedAt(DateTimeInterface $createdAt): static
  62.     {
  63.         $this->createdAt $createdAt;
  64.         return $this;
  65.     }
  66.     public function getUpdatedAt(): ?DateTimeInterface
  67.     {
  68.         return $this->updatedAt;
  69.     }
  70.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  71.     {
  72.         $this->updatedAt $updatedAt;
  73.         return $this;
  74.     }
  75.     public function getDeletedAt(): ?DateTimeInterface
  76.     {
  77.         return $this->deletedAt;
  78.     }
  79.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  80.     {
  81.         $this->deletedAt $deletedAt;
  82.         return $this;
  83.     }
  84. }