src/Domain/Entity/ConsortiumLaboral.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Shared\Domain\Validator as CRLAssert;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Uid\Uuid;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. class ConsortiumLaboral
  11. {
  12.     /**
  13.      * @var string|null
  14.      * @Assert\Length( max=9, maxMessage="max_length {{ limit }}")
  15.      * @CRLAssert\ConstraintCIF()
  16.      */
  17.     private ?string $cif null;
  18.     /**
  19.      * @var string|null
  20.      * @Assert\NotBlank(message="not_blank")
  21.      */
  22.     private ?string $razonSocial null;
  23.     private ?string $descripcion null;
  24.     /**
  25.      * @var string|null
  26.      * @Assert\NotBlank(message="not_blank")
  27.      */
  28.     private ?string $direccion null;
  29.     /**
  30.      * @var string|null
  31.      * @Assert\NotBlank(message="not_blank")
  32.      */
  33.     private ?string $cp null;
  34.     /**
  35.      * @var string|null
  36.      * @Assert\NotBlank(message="not_blank")
  37.      * @Assert\Regex(
  38.      *     pattern="/^[0-9]+$/",
  39.      *     match=true,
  40.      *     message="The value {{ value }} is not a valid phone number"
  41.      * )
  42.      */
  43.     private ?string $telefono null;
  44.     /**
  45.      * @var string|null
  46.      * @Assert\Email(message="is_not_valid")
  47.      * @Assert\NotBlank(message="not_blank")
  48.      */
  49.     private ?string $email null;
  50.     private ?bool $active null;
  51.     private ?\DateTimeInterface $createdAt null;
  52.     private ?\DateTimeInterface $updatedAt null;
  53.     private ?\DateTimeInterface $deletedAt null;
  54.     private ?Uuid $id null;
  55.     /**
  56.      * @var Municipio|null
  57.      * @Assert\NotBlank(message="not_blank")
  58.      */
  59.     private ?Municipio $municipio null;
  60.     /**
  61.      * @var Provincia|null
  62.      * @Assert\NotBlank(message="not_blank")
  63.      */
  64.     private ?Provincia $provincia null;
  65.     private ?Persona $personaContacto null;
  66.     public function __toString(): string
  67.     {
  68.         return $this->getRazonSocial() ?? '---';
  69.     }
  70.     public function getCif(): ?string
  71.     {
  72.         return $this->cif;
  73.     }
  74.     public function setCif(?string $cif): static
  75.     {
  76.         $this->cif $cif;
  77.         return $this;
  78.     }
  79.     public function getRazonSocial(): ?string
  80.     {
  81.         return $this->razonSocial;
  82.     }
  83.     public function setRazonSocial(?string $razonSocial): static
  84.     {
  85.         $this->razonSocial $razonSocial;
  86.         return $this;
  87.     }
  88.     public function getDescripcion(): ?string
  89.     {
  90.         return $this->descripcion;
  91.     }
  92.     public function setDescripcion(?string $descripcion): static
  93.     {
  94.         $this->descripcion $descripcion;
  95.         return $this;
  96.     }
  97.     public function getDireccion(): ?string
  98.     {
  99.         return $this->direccion;
  100.     }
  101.     public function setDireccion(?string $direccion): static
  102.     {
  103.         $this->direccion $direccion;
  104.         return $this;
  105.     }
  106.     public function getCp(): ?string
  107.     {
  108.         return $this->cp;
  109.     }
  110.     public function setCp(?string $cp): static
  111.     {
  112.         $this->cp $cp;
  113.         return $this;
  114.     }
  115.     public function getTelefono(): ?string
  116.     {
  117.         return $this->telefono;
  118.     }
  119.     public function setTelefono(?string $telefono): static
  120.     {
  121.         $this->telefono $telefono;
  122.         return $this;
  123.     }
  124.     public function getEmail(): ?string
  125.     {
  126.         return $this->email;
  127.     }
  128.     public function setEmail(?string $email): static
  129.     {
  130.         $this->email $email;
  131.         return $this;
  132.     }
  133.     public function isActive(): ?bool
  134.     {
  135.         return $this->active;
  136.     }
  137.     public function setActive(?bool $active): static
  138.     {
  139.         $this->active $active;
  140.         return $this;
  141.     }
  142.     public function getCreatedAt(): ?\DateTimeInterface
  143.     {
  144.         return $this->createdAt;
  145.     }
  146.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  147.     {
  148.         $this->createdAt $createdAt;
  149.         return $this;
  150.     }
  151.     public function getUpdatedAt(): ?\DateTimeInterface
  152.     {
  153.         return $this->updatedAt;
  154.     }
  155.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  156.     {
  157.         $this->updatedAt $updatedAt;
  158.         return $this;
  159.     }
  160.     public function getDeletedAt(): ?\DateTimeInterface
  161.     {
  162.         return $this->deletedAt;
  163.     }
  164.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  165.     {
  166.         $this->deletedAt $deletedAt;
  167.         return $this;
  168.     }
  169.     public function getId(): ?Uuid
  170.     {
  171.         return $this->id;
  172.     }
  173.     public function getMunicipio(): ?Municipio
  174.     {
  175.         return $this->municipio;
  176.     }
  177.     public function setMunicipio(?Municipio $municipio): static
  178.     {
  179.         $this->municipio $municipio;
  180.         return $this;
  181.     }
  182.     public function getProvincia(): ?Provincia
  183.     {
  184.         return $this->provincia;
  185.     }
  186.     public function setProvincia(?Provincia $provincia): static
  187.     {
  188.         $this->provincia $provincia;
  189.         return $this;
  190.     }
  191.     public function getPersonaContacto(): ?Persona
  192.     {
  193.         return $this->personaContacto;
  194.     }
  195.     public function setPersonaContacto(?Persona $persona): static
  196.     {
  197.         $this->personaContacto $persona;
  198.         return $this;
  199.     }
  200.     public function getPersonasContacto():Collection
  201.     {
  202.         $personas = new ArrayCollection();
  203.         if($this->getPersonaContacto()) {
  204.             $personas->add($this->getPersonaContacto());
  205.         }
  206.         return $personas;
  207.     }
  208. }