<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\ActionPlanTasksRepository;
use App\Traits\AutoTimestampTrait;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: ActionPlanTasksRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['task.get']],
denormalizationContext: ['groups' => ['task.write']],
)]
#[ORM\HasLifecycleCallbacks]
class ActionPlanTasks
{
use AutoTimestampTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['task.get', 'task.write', 'plan.get' ])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?string $title = null;
#[ORM\ManyToOne]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?User $userInCharge = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?\DateTimeInterface $startDate = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?\DateTimeInterface $endDate = null;
#[ORM\Column(nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?int $rateProgress = null;
#[ORM\ManyToOne(inversedBy: 'actionPlanTasks')]
#[ORM\JoinColumn(nullable: false)]
#[Groups(['task.write'])]
private ?ActionPlan $actionPlan = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?string $thematic = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?string $description = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?string $comment = null;
#[ORM\Column(nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?bool $reminderFixed = null;
#[ORM\Column(nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?int $reminderBeforeDeadline = null;
#[ORM\Column(nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?bool $reminderPeriodic = null;
#[ORM\Column(nullable: true)]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?int $periodicReminderTime = null;
#[ORM\ManyToOne]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?User $createdBy = null;
#[ORM\ManyToOne]
#[Groups(['task.get', 'task.write', 'plan.get'])]
private ?User $updatedBy = null;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getUserInCharge(): ?User
{
return $this->userInCharge;
}
public function setUserInCharge(?User $userInCharge): self
{
$this->userInCharge = $userInCharge;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getRateProgress(): ?int
{
return $this->rateProgress;
}
public function setRateProgress(?int $rateProgress): self
{
$this->rateProgress = $rateProgress;
return $this;
}
public function getActionPlan(): ?ActionPlan
{
return $this->actionPlan;
}
public function setActionPlan(?ActionPlan $actionPlan): self
{
$this->actionPlan = $actionPlan;
return $this;
}
public function getThematic(): ?string
{
return $this->thematic;
}
public function setThematic(?string $thematic): self
{
$this->thematic = $thematic;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function isReminderFixed(): ?bool
{
return $this->reminderFixed;
}
public function setReminderFixed(?bool $reminderFixed): self
{
$this->reminderFixed = $reminderFixed;
return $this;
}
public function getReminderBeforeDeadline(): ?int
{
return $this->reminderBeforeDeadline;
}
public function setReminderBeforeDeadline(?int $reminderBeforeDeadline): self
{
$this->reminderBeforeDeadline = $reminderBeforeDeadline;
return $this;
}
public function isReminderPeriodic(): ?bool
{
return $this->reminderPeriodic;
}
public function setReminderPeriodic(?bool $reminderPeriodic): self
{
$this->reminderPeriodic = $reminderPeriodic;
return $this;
}
public function getPeriodicReminderTime(): ?int
{
return $this->periodicReminderTime;
}
public function setPeriodicReminderTime(?int $periodicReminderTime): self
{
$this->periodicReminderTime = $periodicReminderTime;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function setUpdatedBy(?User $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
}