<?phpnamespace App\Entity;use App\Repository\TimeRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: TimeRepository::class)]class Time{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(["getTimes"])] private ?int $id = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] #[Groups(["getTimes"])] private ?\DateTimeInterface $start = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] #[Groups(["getTimes"])] private ?\DateTimeInterface $end = null; #[ORM\Column(type: Types::TEXT, nullable: true)] #[Groups(["getTimes"])] private ?string $description = null; #[ORM\ManyToOne(inversedBy: 'times')] #[Groups(["getTimes"])] private ?Project $project = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] #[Groups(["getTimes"])] private ?User $user = null; #[ORM\ManyToOne] #[Groups(["getTimes"])] private ?TagType $tagType = null; #[ORM\ManyToOne] #[Groups(["getTimes"])] private ?TagOrg $tagOrg = null; //#[ORM\OneToOne(inversedBy: 'time', cascade: ['persist', 'remove'])] //Ligne commentée en attendant de pouvoir gérer la condition du remove : uniquement si la planif n'a pas de réservation //Supprimer la planif si elle vient d'un pointage sans planif sinon garder la planif #[ORM\OneToOne(inversedBy: 'time', cascade: ['persist'])] private ?Schedules $schedules = null; public function getId(): ?int { return $this->id; } public function getStart(): ?\DateTimeInterface { return $this->start; } public function setStart(\DateTimeInterface $start): self { $this->start = $start; return $this; } public function getEnd(): ?\DateTimeInterface { return $this->end; } public function setEnd(?\DateTimeInterface $end): self { $this->end = $end; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getProject(): ?project { return $this->project; } public function setProject(?project $project): self { $this->project = $project; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getTagType(): ?TagType { return $this->tagType; } public function setTagType(?TagType $tagType): self { $this->tagType = $tagType; return $this; } public function getTagOrg(): ?TagOrg { return $this->tagOrg; } public function setTagOrg(?TagOrg $tagOrg): self { $this->tagOrg = $tagOrg; return $this; } public function getSchedules(): ?Schedules { return $this->schedules; } public function setSchedules(?Schedules $schedules): self { $this->schedules = $schedules; return $this; } }