<?phpnamespace App\Entity;use App\Repository\ParHorarioRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParHorarioRepository::class)]class ParHorario { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $nombre = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $observacion = null; #[ORM\ManyToOne(inversedBy: 'horarios')] private ?ParEstado $estado = null; #[ORM\OneToMany(mappedBy: 'horario', targetEntity: ParHorarioDia::class)] private Collection $horarioDias; #[ORM\Column(length: 100)] private ?string $createUser = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $createAt = null; #[ORM\Column(length: 100)] private ?string $updateUser = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $updateAt = null; #[ORM\OneToMany(mappedBy: 'horario', targetEntity: SegHomeOffice::class)] private Collection $homeOffice; #[ORM\ManyToMany(targetEntity: TerPersona::class, inversedBy: 'horarios')] private Collection $usuario; #[ORM\Column(length: 255, nullable: true)] private ?string $horaInicio = null; #[ORM\Column(length: 255)] private ?string $horaFin = null; public function __toString(): string { return $this->getNombre(); } public function __construct() { $this->horarioDias = new ArrayCollection(); $this->homeOffice = new ArrayCollection(); $this->usuario = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): static { $this->nombre = $nombre; return $this; } public function getObservacion(): ?string { return $this->observacion; } public function setObservacion(?string $observacion): static { $this->observacion = $observacion; return $this; } public function getEstado(): ?ParEstado { return $this->estado; } public function setEstado(?ParEstado $estado): static { $this->estado = $estado; return $this; } /** * @return Collection<int, ParHorarioDia> */ public function getHorarioDias(): Collection { return $this->horarioDias; } public function addHorarioDia(ParHorarioDia $horarioDia): static { if (!$this->horarioDias->contains($horarioDia)) { $this->horarioDias->add($horarioDia); $horarioDia->setHorario($this); } return $this; } public function removeHorarioDia(ParHorarioDia $horarioDia): static { if ($this->horarioDias->removeElement($horarioDia)) { // set the owning side to null (unless already changed) if ($horarioDia->getHorario() === $this) { $horarioDia->setHorario(null); } } return $this; } public function getCreateUser(): ?string { return $this->createUser; } public function setCreateUser(string $createUser): static { $this->createUser = $createUser; return $this; } public function getCreateAt(): ?\DateTimeInterface { return $this->createAt; } public function setCreateAt(\DateTimeInterface $createAt): static { $this->createAt = $createAt; return $this; } public function getUpdateUser(): ?string { return $this->updateUser; } public function setUpdateUser(string $updateUser): static { $this->updateUser = $updateUser; return $this; } public function getUpdateAt(): ?\DateTimeInterface { return $this->updateAt; } public function setUpdateAt(\DateTimeInterface $updateAt): static { $this->updateAt = $updateAt; return $this; } /** * @return Collection<int, SegHomeOffice> */ public function getHomeOffice(): Collection { return $this->homeOffice; } public function addHomeOffice(SegHomeOffice $homeOffice): static { if (!$this->homeOffice->contains($homeOffice)) { $this->homeOffice->add($homeOffice); $homeOffice->setHorario($this); } return $this; } public function removeHomeOffice(SegHomeOffice $homeOffice): static { if ($this->homeOffice->removeElement($homeOffice)) { // set the owning side to null (unless already changed) if ($homeOffice->getHorario() === $this) { $homeOffice->setHorario(null); } } return $this; } /** * @return Collection<int, TerPersona> */ public function getUsuario(): Collection { return $this->usuario; } public function addUsuario(TerPersona $usuario): static { if (!$this->usuario->contains($usuario)) { $this->usuario->add($usuario); } return $this; } public function removeUsuario(TerPersona $usuario): static { $this->usuario->removeElement($usuario); return $this; } public function getHoraInicio(): ?string { return $this->horaInicio; } public function setHoraInicio(?string $horaInicio): static { $this->horaInicio = $horaInicio; return $this; } public function getHoraFin(): ?string { return $this->horaFin; } public function setHoraFin(string $horaFin): static { $this->horaFin = $horaFin; return $this; }}