src/Entity/GHGrupoTrabajo.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GHGrupoTrabajoRepository;
  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(repositoryClassGHGrupoTrabajoRepository::class)]
  9. class GHGrupoTrabajo
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $nombre null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $createAt null;
  19.     #[ORM\Column(length50)]
  20.     private ?string $createUser null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  22.     private ?\DateTimeInterface $updateAt null;
  23.     #[ORM\Column(length50)]
  24.     private ?string $updateUser null;
  25.     #[ORM\ManyToOne(inversedBy'grupoTrabajoJefe')]
  26.     private ?TerPersona $director null;
  27.     #[ORM\ManyToOne(inversedBy'grupoTrabajoCoordinador')]
  28.     private ?TerPersona $coordinador null;
  29.     #[ORM\ManyToOne(inversedBy'grupoTrabajo')]
  30.     private ?ParProceso $proceso null;
  31.     #[ORM\ManyToOne(inversedBy'grupoTrabajo')]
  32.     private ?ParSubproceso $subProceso null;
  33.     #[ORM\ManyToMany(targetEntityTerPersona::class, inversedBy'grupoTrabajoColaboradores')]
  34.     private Collection $colaboradores;
  35.     #[ORM\OneToMany(mappedBy'grupoTrabajo'targetEntityGHGestionTurno::class, cascade: ['persist'], orphanRemovaltrue)]
  36.     private Collection $gestionTurno;
  37.     #[ORM\ManyToOne(inversedBy'gHGrupoTrabajos')]
  38.     private ?TerSedeEmpresa $sucursal null;
  39.     public function __construct()
  40.     {
  41.         $this->colaboradores = new ArrayCollection();
  42.         $this->gestionTurno = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getNombre(): ?string
  49.     {
  50.         return $this->nombre;
  51.     }
  52.     public function setNombre(string $nombre): static
  53.     {
  54.         $this->nombre $nombre;
  55.         return $this;
  56.     }
  57.     public function getCreateAt(): ?\DateTimeInterface
  58.     {
  59.         return $this->createAt;
  60.     }
  61.     public function setCreateAt(\DateTimeInterface $createAt): static
  62.     {
  63.         $this->createAt $createAt;
  64.         return $this;
  65.     }
  66.     public function getCreateUser(): ?string
  67.     {
  68.         return $this->createUser;
  69.     }
  70.     public function setCreateUser(string $createUser): static
  71.     {
  72.         $this->createUser $createUser;
  73.         return $this;
  74.     }
  75.     public function getUpdateAt(): ?\DateTimeInterface
  76.     {
  77.         return $this->updateAt;
  78.     }
  79.     public function setUpdateAt(\DateTimeInterface $updateAt): static
  80.     {
  81.         $this->updateAt $updateAt;
  82.         return $this;
  83.     }
  84.     public function getUpdateUser(): ?string
  85.     {
  86.         return $this->updateUser;
  87.     }
  88.     public function setUpdateUser(string $updateUser): static
  89.     {
  90.         $this->updateUser $updateUser;
  91.         return $this;
  92.     }
  93.     public function getDirector(): ?TerPersona
  94.     {
  95.         return $this->director;
  96.     }
  97.     public function setDirector(?TerPersona $director): static
  98.     {
  99.         $this->director $director;
  100.         return $this;
  101.     }
  102.     public function getCoordinador(): ?TerPersona
  103.     {
  104.         return $this->coordinador;
  105.     }
  106.     public function setCoordinador(?TerPersona $coordinador): static
  107.     {
  108.         $this->coordinador $coordinador;
  109.         return $this;
  110.     }
  111.     public function getProceso(): ?ParProceso
  112.     {
  113.         return $this->proceso;
  114.     }
  115.     public function setProceso(?ParProceso $proceso): static
  116.     {
  117.         $this->proceso $proceso;
  118.         return $this;
  119.     }
  120.     public function getSubProceso(): ?ParSubproceso
  121.     {
  122.         return $this->subProceso;
  123.     }
  124.     public function setSubProceso(?ParSubproceso $subProceso): static
  125.     {
  126.         $this->subProceso $subProceso;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, TerPersona>
  131.      */
  132.     public function getColaboradores(): Collection
  133.     {
  134.         return $this->colaboradores;
  135.     }
  136.     public function addColaborador(TerPersona $colaborador): static
  137.     {
  138.         if (!$this->colaboradores->contains($colaborador)) {
  139.             $this->colaboradores->add($colaborador);
  140.             $colaborador->addGrupoTrabajoColaborador($this); // 👈 mantener sincronía
  141.         }
  142.         return $this;
  143.     }
  144.     
  145.     public function removeColaborador(TerPersona $colaborador): static
  146.     {
  147.         if ($this->colaboradores->removeElement($colaborador)) {
  148.             $colaborador->removeGrupoTrabajoColaborador($this); // 👈 mantener sincronía
  149.         }
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return Collection<int, GHGestionTurno>
  154.      */
  155.     public function getGestionTurno(): Collection
  156.     {
  157.         return $this->gestionTurno;
  158.     }
  159.     public function addGestionTurno(GHGestionTurno $gestionTurno): static
  160.     {
  161.         if (!$this->gestionTurno->contains($gestionTurno)) {
  162.             $this->gestionTurno->add($gestionTurno);
  163.             $gestionTurno->setGrupoTrabajo($this);
  164.         }
  165.         return $this;
  166.     }
  167.     public function removeGestionTurno(GHGestionTurno $gestionTurno): static
  168.     {
  169.         if ($this->gestionTurno->removeElement($gestionTurno)) {
  170.             // set the owning side to null (unless already changed)
  171.             if ($gestionTurno->getGrupoTrabajo() === $this) {
  172.                 $gestionTurno->setGrupoTrabajo(null);
  173.             }
  174.         }
  175.         return $this;
  176.     }
  177.     public function getSucursal(): ?TerSedeEmpresa
  178.     {
  179.         return $this->sucursal;
  180.     }
  181.     public function setSucursal(?TerSedeEmpresa $sucursal): static
  182.     {
  183.         $this->sucursal $sucursal;
  184.         return $this;
  185.     }
  186. }