<?phpnamespace App\Domain\Entity;use App\Shared\Domain\Validator as CRLAssert;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Uid\Uuid;use Symfony\Component\Validator\Constraints as Assert;class Preco{ private ?Uuid $id = null; /** * @var string|null * @Assert\Length( max=9, maxMessage="max_length {{ limit }}") * @CRLAssert\ConstraintNIF() * @Assert\NotBlank(message="not_blank") */ private ?string $dni = null; /** * @var string|null * @Assert\NotBlank(message="not_blank") */ private ?string $nombre = null; /** * @var string|null * @Assert\NotBlank(message="not_blank") */ private ?string $primerApellido = null; /** * @var string|null * @Assert\NotBlank(message="not_blank") */ private ?string $segundoApellido = null; /** * @var string|null * @Assert\NotBlank(message="not_blank") */ private ?string $representacion = null; /** * @var string|null * @Assert\NotBlank(message="not_blank") * @Assert\Regex( * pattern="/^[0-9]+$/", * match=true, * message="The value {{ value }} is not a valid phone number" * ) */ private ?string $telefono = null; /** * @var string|null * @Assert\Email(message="is_not_valid") * @Assert\NotBlank(message="not_blank") */ private ?string $email = null; private ?bool $active = null; private ?DateTimeInterface $createdAt = null; private ?DateTimeInterface $updatedAt = null; private ?DateTimeInterface $deletedAt = null; private Collection $minutas; public function __construct() { $this->minutas = new ArrayCollection(); } public function __toString(): string { return $this->getNombreCompleto(); } public function getDni(): ?string { return $this->dni; } public function setDni(?string $dni): static { $this->dni = $dni; return $this; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(?string $nombre): static { $this->nombre = $nombre; return $this; } public function getPrimerApellido(): ?string { return $this->primerApellido; } public function setPrimerApellido(?string $primerApellido): static { $this->primerApellido = $primerApellido; return $this; } public function getSegundoApellido(): ?string { return $this->segundoApellido; } public function setSegundoApellido(?string $segundoApellido): static { $this->segundoApellido = $segundoApellido; return $this; } public function getRepresentacion(): ?string { return $this->representacion; } public function setRepresentacion(?string $representacion): static { $this->representacion = $representacion; return $this; } public function getTelefono(): ?string { return $this->telefono; } public function setTelefono(?string $telefono): static { $this->telefono = $telefono; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): static { $this->email = $email; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(?bool $active): static { $this->active = $active; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function getDeletedAt(): ?\DateTimeInterface { return $this->deletedAt; } public function setDeletedAt(?\DateTimeInterface $deletedAt): static { $this->deletedAt = $deletedAt; return $this; } public function getId(): ?Uuid { return $this->id; } /** * @return Collection<int, Minuta> */ public function getMinutas(): Collection { return $this->minutas; } public function addMinuta(Minuta $minuta): static { if (!$this->minutas->contains($minuta)) { $this->minutas->add($minuta); $minuta->setPreco($this); } return $this; } public function removeMinuta(Minuta $minuta): static { if ($this->minutas->removeElement($minuta)) { // set the owning side to null (unless already changed) if ($minuta->getPreco() === $this) { $minuta->setPreco(null); } } return $this; } public function getNombreCompleto():string { return implode(' ', [$this->getNombre(), $this->getPrimerApellido(), $this->getSegundoApellido()])??'---'; }}