src/Entity/TimeSpent.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TimeSpentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. #[ORM\Entity(repositoryClassTimeSpentRepository::class)]
  7. class TimeSpent
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     #[Groups(['LogService'])]
  13.     private $id;
  14.     #[ORM\Column(type'float')]
  15.     #[Groups(['LogService'])]
  16.     private $hours;
  17.     #[ORM\Column(type'date')]
  18.     #[Groups(['LogService'])]
  19.     private $date;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     #[Groups(['LogService'])]
  22.     private $updatedAt;
  23.     #[ORM\Column(type'datetime')]
  24.     #[Groups(['LogService'])]
  25.     private $createdAt;
  26.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'timeSpents')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private $user;
  29.     #[ORM\ManyToOne(targetEntityTask::class, inversedBy'timeSpents')]
  30.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  31.     private $task;
  32.     #[ORM\Column(type'float'nullabletrue)]
  33.     private $hourlyRate;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getHours(): ?float
  39.     {
  40.         return $this->hours;
  41.     }
  42.     public function setHours(float $hours): self
  43.     {
  44.         $this->hours $hours;
  45.         return $this;
  46.     }
  47.     public function getDate(): ?\DateTimeInterface
  48.     {
  49.         return $this->date;
  50.     }
  51.     public function setDate(\DateTimeInterface $date): self
  52.     {
  53.         $this->date $date;
  54.         return $this;
  55.     }
  56.     public function getUpdatedAt(): ?\DateTimeInterface
  57.     {
  58.         return $this->updatedAt;
  59.     }
  60.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  61.     {
  62.         $this->updatedAt $updatedAt;
  63.         return $this;
  64.     }
  65.     public function getCreatedAt(): ?\DateTime
  66.     {
  67.         return $this->createdAt;
  68.     }
  69.     public function setCreatedAt(\DateTime $createdAt): self
  70.     {
  71.         $this->createdAt $createdAt;
  72.         return $this;
  73.     }
  74.     public function getUser(): ?User
  75.     {
  76.         return $this->user;
  77.     }
  78.     public function setUser(?User $user): self
  79.     {
  80.         $this->user $user;
  81.         return $this;
  82.     }
  83.     public function getTask(): ?Task
  84.     {
  85.         return $this->task;
  86.     }
  87.     public function setTask(?Task $task): self
  88.     {
  89.         $this->task $task;
  90.         return $this;
  91.     }
  92.     public function getHourlyRate(): ?float
  93.     {
  94.         return $this->hourlyRate;
  95.     }
  96.     public function setHourlyRate(?float $hourlyRate): self
  97.     {
  98.         $this->hourlyRate $hourlyRate;
  99.         return $this;
  100.     }
  101. }