<?php
namespace App\Entity;
use App\Repository\TimeSpentRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: TimeSpentRepository::class)]
class TimeSpent
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['LogService'])]
private $id;
#[ORM\Column(type: 'float')]
#[Groups(['LogService'])]
private $hours;
#[ORM\Column(type: 'date')]
#[Groups(['LogService'])]
private $date;
#[ORM\Column(type: 'datetime', nullable: true)]
#[Groups(['LogService'])]
private $updatedAt;
#[ORM\Column(type: 'datetime')]
#[Groups(['LogService'])]
private $createdAt;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'timeSpents')]
#[ORM\JoinColumn(nullable: false)]
private $user;
#[ORM\ManyToOne(targetEntity: Task::class, inversedBy: 'timeSpents')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private $task;
#[ORM\Column(type: 'float', nullable: true)]
private $hourlyRate;
public function getId(): ?int
{
return $this->id;
}
public function getHours(): ?float
{
return $this->hours;
}
public function setHours(float $hours): self
{
$this->hours = $hours;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getTask(): ?Task
{
return $this->task;
}
public function setTask(?Task $task): self
{
$this->task = $task;
return $this;
}
public function getHourlyRate(): ?float
{
return $this->hourlyRate;
}
public function setHourlyRate(?float $hourlyRate): self
{
$this->hourlyRate = $hourlyRate;
return $this;
}
}