src/Domain/Entity/OrganoRepresentacion.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Domain\Interfaces\IntervinienteInterface;
  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 Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Uid\Uuid;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. class OrganoRepresentacion implements IntervinienteInterface
  13. {
  14.     /**
  15.      * @var string|null
  16.      * @Assert\NotBlank(message="not_blank")
  17.      */
  18.     private ?string $nombre null;
  19.     private ?string $direccion null;
  20.     /**
  21.      * @var string|null
  22.      * @Assert\Regex(
  23.      *     pattern="/^[0-9]+$/",
  24.      *     match=true,
  25.      *     message="The value {{ value }} is not a valid phone number"
  26.      * )
  27.      */
  28.     private ?string $telefono null;
  29.     /**
  30.      * @var string|null
  31.      * @Assert\Email(message="is_not_valid")
  32.      */
  33.     private ?string $email null;
  34.     private ?DateTimeInterface $createdAt null;
  35.     private ?DateTimeInterface $updatedAt null;
  36.     private ?DateTimeInterface $deletedAt null;
  37.     private ?Uuid $id null;
  38.     /**
  39.      * @var Empresa|null
  40.      * @Assert\NotBlank(message="not_blank")
  41.      */
  42.     private ?Empresa $empresa null;
  43.     private Collection $personasContacto;
  44.     public function __construct()
  45.     {
  46.         $this->personasContacto = new ArrayCollection();
  47.     }
  48.     public function __toString(): string
  49.     {
  50.         return $this->getNombre()??'---';
  51.     }
  52.     public function getNombre(): ?string
  53.     {
  54.         return $this->nombre;
  55.     }
  56.     public function setNombre(?string $nombre): static
  57.     {
  58.         $this->nombre $nombre;
  59.         return $this;
  60.     }
  61.     public function getDireccion(): ?string
  62.     {
  63.         return $this->direccion;
  64.     }
  65.     public function setDireccion(?string $direccion): static
  66.     {
  67.         $this->direccion $direccion;
  68.         return $this;
  69.     }
  70.     public function getTelefono(): ?string
  71.     {
  72.         return $this->telefono;
  73.     }
  74.     public function setTelefono(?string $telefono): static
  75.     {
  76.         $this->telefono $telefono;
  77.         return $this;
  78.     }
  79.     public function getEmail(): ?string
  80.     {
  81.         return $this->email;
  82.     }
  83.     public function setEmail(?string $email): static
  84.     {
  85.         $this->email $email;
  86.         return $this;
  87.     }
  88.     public function getCreatedAt(): ?DateTimeInterface
  89.     {
  90.         return $this->createdAt;
  91.     }
  92.     public function setCreatedAt(DateTimeInterface $createdAt): static
  93.     {
  94.         $this->createdAt $createdAt;
  95.         return $this;
  96.     }
  97.     public function getUpdatedAt(): ?DateTimeInterface
  98.     {
  99.         return $this->updatedAt;
  100.     }
  101.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  102.     {
  103.         $this->updatedAt $updatedAt;
  104.         return $this;
  105.     }
  106.     public function getDeletedAt(): ?DateTimeInterface
  107.     {
  108.         return $this->deletedAt;
  109.     }
  110.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  111.     {
  112.         $this->deletedAt $deletedAt;
  113.         return $this;
  114.     }
  115.     public function getId(): ?Uuid
  116.     {
  117.         return $this->id;
  118.     }
  119.     public function getEmpresa(): ?Empresa
  120.     {
  121.         return $this->empresa;
  122.     }
  123.     public function setEmpresa(?Empresa $empresa): static
  124.     {
  125.         $this->empresa $empresa;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, Persona>
  130.      */
  131.     public function getPersonasContacto(): Collection
  132.     {
  133.         return $this->personasContacto;
  134.     }
  135.     public function addPersonasContacto(Persona $personasContacto): static
  136.     {
  137.         if (!$this->personasContacto->contains($personasContacto)) {
  138.             $this->personasContacto->add($personasContacto);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removePersonasContacto(Persona $personasContacto): static
  143.     {
  144.         $this->personasContacto->removeElement($personasContacto);
  145.         return $this;
  146.     }
  147.     public function getContactos(): Collection
  148.     {
  149.         return $this->getPersonasContacto();
  150.     }
  151. }