src/Entity/ParHorario.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParHorarioRepository;
  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. #[ORM\Entity(repositoryClassParHorarioRepository::class)]
  9. class ParHorario {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nombre null;
  16.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  17.     private ?string $observacion null;
  18.     #[ORM\ManyToOne(inversedBy'horarios')]
  19.     private ?ParEstado $estado null;
  20.     #[ORM\OneToMany(mappedBy'horario'targetEntityParHorarioDia::class)]
  21.     private Collection $horarioDias;
  22.     #[ORM\Column(length100)]
  23.     private ?string $createUser null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  25.     private ?\DateTimeInterface $createAt null;
  26.     #[ORM\Column(length100)]
  27.     private ?string $updateUser null;
  28.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  29.     private ?\DateTimeInterface $updateAt null;
  30.     #[ORM\OneToMany(mappedBy'horario'targetEntitySegHomeOffice::class)]
  31.     private Collection $homeOffice;
  32.     #[ORM\ManyToMany(targetEntityTerPersona::class, inversedBy'horarios')]
  33.     private Collection $usuario;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $horaInicio null;
  36.     #[ORM\Column(length255)]
  37.     private ?string $horaFin null;
  38.     public function __toString(): string {
  39.         return $this->getNombre();
  40.     }
  41.     public function __construct() {
  42.         $this->horarioDias = new ArrayCollection();
  43.         $this->homeOffice = new ArrayCollection();
  44.         $this->usuario = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int {
  47.         return $this->id;
  48.     }
  49.     public function getNombre(): ?string {
  50.         return $this->nombre;
  51.     }
  52.     public function setNombre(string $nombre): static {
  53.         $this->nombre $nombre;
  54.         return $this;
  55.     }
  56.     public function getObservacion(): ?string {
  57.         return $this->observacion;
  58.     }
  59.     public function setObservacion(?string $observacion): static {
  60.         $this->observacion $observacion;
  61.         return $this;
  62.     }
  63.     public function getEstado(): ?ParEstado {
  64.         return $this->estado;
  65.     }
  66.     public function setEstado(?ParEstado $estado): static {
  67.         $this->estado $estado;
  68.         return $this;
  69.     }
  70.     /**
  71.      * @return Collection<int, ParHorarioDia>
  72.      */
  73.     public function getHorarioDias(): Collection {
  74.         return $this->horarioDias;
  75.     }
  76.     public function addHorarioDia(ParHorarioDia $horarioDia): static {
  77.         if (!$this->horarioDias->contains($horarioDia)) {
  78.             $this->horarioDias->add($horarioDia);
  79.             $horarioDia->setHorario($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeHorarioDia(ParHorarioDia $horarioDia): static {
  84.         if ($this->horarioDias->removeElement($horarioDia)) {
  85.             // set the owning side to null (unless already changed)
  86.             if ($horarioDia->getHorario() === $this) {
  87.                 $horarioDia->setHorario(null);
  88.             }
  89.         }
  90.         return $this;
  91.     }
  92.     public function getCreateUser(): ?string {
  93.         return $this->createUser;
  94.     }
  95.     public function setCreateUser(string $createUser): static {
  96.         $this->createUser $createUser;
  97.         return $this;
  98.     }
  99.     public function getCreateAt(): ?\DateTimeInterface {
  100.         return $this->createAt;
  101.     }
  102.     public function setCreateAt(\DateTimeInterface $createAt): static {
  103.         $this->createAt $createAt;
  104.         return $this;
  105.     }
  106.     public function getUpdateUser(): ?string {
  107.         return $this->updateUser;
  108.     }
  109.     public function setUpdateUser(string $updateUser): static {
  110.         $this->updateUser $updateUser;
  111.         return $this;
  112.     }
  113.     public function getUpdateAt(): ?\DateTimeInterface {
  114.         return $this->updateAt;
  115.     }
  116.     public function setUpdateAt(\DateTimeInterface $updateAt): static {
  117.         $this->updateAt $updateAt;
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, SegHomeOffice>
  122.      */
  123.     public function getHomeOffice(): Collection {
  124.         return $this->homeOffice;
  125.     }
  126.     public function addHomeOffice(SegHomeOffice $homeOffice): static {
  127.         if (!$this->homeOffice->contains($homeOffice)) {
  128.             $this->homeOffice->add($homeOffice);
  129.             $homeOffice->setHorario($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeHomeOffice(SegHomeOffice $homeOffice): static {
  134.         if ($this->homeOffice->removeElement($homeOffice)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($homeOffice->getHorario() === $this) {
  137.                 $homeOffice->setHorario(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142.     /**
  143.      * @return Collection<int, TerPersona>
  144.      */
  145.     public function getUsuario(): Collection {
  146.         return $this->usuario;
  147.     }
  148.     public function addUsuario(TerPersona $usuario): static {
  149.         if (!$this->usuario->contains($usuario)) {
  150.             $this->usuario->add($usuario);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeUsuario(TerPersona $usuario): static {
  155.         $this->usuario->removeElement($usuario);
  156.         return $this;
  157.     }
  158.     public function getHoraInicio(): ?string
  159.     {
  160.         return $this->horaInicio;
  161.     }
  162.     public function setHoraInicio(?string $horaInicio): static
  163.     {
  164.         $this->horaInicio $horaInicio;
  165.         return $this;
  166.     }
  167.     public function getHoraFin(): ?string
  168.     {
  169.         return $this->horaFin;
  170.     }
  171.     public function setHoraFin(string $horaFin): static
  172.     {
  173.         $this->horaFin $horaFin;
  174.         return $this;
  175.     }
  176. }