Files
symfony-k3s/src/Entity/Task.php
T
2026-08-11 11:48:40 +02:00

168 lines
3.3 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\TaskRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TaskRepository::class)]
class Task
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $title = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private ?int $estimatedDurationMinutes = null;
#[ORM\Column(length: 20)]
private ?string $priority = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $category = null;
#[ORM\Column]
private ?bool $isRecurring = null;
#[ORM\Column]
private ?bool $isActive = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column]
private ?\DateTimeImmutable $updatedAt = null;
public function __construct()
{
$now = new \DateTimeImmutable();
$this->priority = 'medium';
$this->isRecurring = false;
$this->isActive = true;
$this->createdAt = $now;
$this->updatedAt = $now;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): static
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getEstimatedDurationMinutes(): ?int
{
return $this->estimatedDurationMinutes;
}
public function setEstimatedDurationMinutes(?int $estimatedDurationMinutes): static
{
$this->estimatedDurationMinutes = $estimatedDurationMinutes;
return $this;
}
public function getPriority(): ?string
{
return $this->priority;
}
public function setPriority(string $priority): static
{
$this->priority = $priority;
return $this;
}
public function getCategory(): ?string
{
return $this->category;
}
public function setCategory(?string $category): static
{
$this->category = $category;
return $this;
}
public function isRecurring(): ?bool
{
return $this->isRecurring;
}
public function setIsRecurring(bool $isRecurring): static
{
$this->isRecurring = $isRecurring;
return $this;
}
public function isActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): static
{
$this->isActive = $isActive;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
}