57 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Entity\Staff;
 | |
| 
 | |
| use App\Entity\System\User;
 | |
| use App\Repository\Staff\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;
 | |
|     }
 | |
| }
 |