mv: Refactor
* Move entities for organization
This commit is contained in:
56
src/Entity/Staff/Supervision.php
Normal file
56
src/Entity/Staff/Supervision.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user