Add supervision classes to support assigning staff supervisors

This commit is contained in:
2024-11-30 20:04:24 -05:00
parent 97de984456
commit 481a2c2f40
3 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?php
namespace App\Entity;
use App\Repository\SupervisionRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: SupervisionRepository::class)]
class Supervision
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?User $supervisor = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?User $worker = null;
public function getId(): ?Uuid
{
return $this->id;
}
public function getSupervisor(): ?User
{
return $this->supervisor;
}
public function setSupervisor(?User $supervisor): static
{
$this->supervisor = $supervisor;
return $this;
}
public function getWorker(): ?User
{
return $this->worker;
}
public function setWorker(User $worker): static
{
$this->worker = $worker;
return $this;
}
}