src/Entity/Time.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TimeRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClassTimeRepository::class)]
  8. class Time
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     #[Groups(["getTimes"])]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  16.     #[Groups(["getTimes"])]
  17.     private ?\DateTimeInterface $start null;
  18.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  19.     #[Groups(["getTimes"])]
  20.     private ?\DateTimeInterface $end null;
  21.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  22.     #[Groups(["getTimes"])]
  23.     private ?string $description null;
  24.     #[ORM\ManyToOne(inversedBy'times')]
  25.     #[Groups(["getTimes"])]
  26.     private ?Project $project null;
  27.     #[ORM\ManyToOne]
  28.     #[ORM\JoinColumn(nullablefalse)]
  29.     #[Groups(["getTimes"])]
  30.     private ?User $user null;
  31.     #[ORM\ManyToOne]
  32.     #[Groups(["getTimes"])]
  33.     private ?TagType $tagType null;
  34.     #[ORM\ManyToOne]
  35.     #[Groups(["getTimes"])]
  36.     private ?TagOrg $tagOrg null;
  37.     //#[ORM\OneToOne(inversedBy: 'time', cascade: ['persist', 'remove'])]
  38.     //Ligne commentée en attendant de pouvoir gérer la condition du remove : uniquement si la planif n'a pas de réservation
  39.     //Supprimer la planif si elle vient d'un pointage sans planif sinon garder la planif
  40.     #[ORM\OneToOne(inversedBy'time'cascade: ['persist'])]
  41.     private ?Schedules $schedules null;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getStart(): ?\DateTimeInterface
  47.     {
  48.         return $this->start;
  49.     }
  50.     public function setStart(\DateTimeInterface $start): self
  51.     {
  52.         $this->start $start;
  53.         return $this;
  54.     }
  55.     public function getEnd(): ?\DateTimeInterface
  56.     {
  57.         return $this->end;
  58.     }
  59.     public function setEnd(?\DateTimeInterface $end): self
  60.     {
  61.         $this->end $end;
  62.         return $this;
  63.     }
  64.     public function getDescription(): ?string
  65.     {
  66.         return $this->description;
  67.     }
  68.     public function setDescription(?string $description): self
  69.     {
  70.         $this->description $description;
  71.         return $this;
  72.     }
  73.     public function getProject(): ?project
  74.     {
  75.         return $this->project;
  76.     }
  77.     public function setProject(?project $project): self
  78.     {
  79.         $this->project $project;
  80.         return $this;
  81.     }
  82.     public function getUser(): ?User
  83.     {
  84.         return $this->user;
  85.     }
  86.     public function setUser(?User $user): self
  87.     {
  88.         $this->user $user;
  89.         return $this;
  90.     }
  91.     public function getTagType(): ?TagType
  92.     {
  93.         return $this->tagType;
  94.     }
  95.     public function setTagType(?TagType $tagType): self
  96.     {
  97.         $this->tagType $tagType;
  98.         return $this;
  99.     }
  100.     public function getTagOrg(): ?TagOrg
  101.     {
  102.         return $this->tagOrg;
  103.     }
  104.     public function setTagOrg(?TagOrg $tagOrg): self
  105.     {
  106.         $this->tagOrg $tagOrg;
  107.         return $this;
  108.     }
  109.     public function getSchedules(): ?Schedules
  110.     {
  111.         return $this->schedules;
  112.     }
  113.     public function setSchedules(?Schedules $schedules): self
  114.     {
  115.         $this->schedules $schedules;
  116.         return $this;
  117.     }
  118.     
  119. }