From 5026d1cedbc71f497a904917fbc3850945fec8ab Mon Sep 17 00:00:00 2001 From: Joren de Graaf Date: Fri, 7 Aug 2026 21:25:42 +0200 Subject: [PATCH] Added Task entity --- src/Entity/Task.php | 156 ++++++++++++++++++++++++++++++ src/Repository/TaskRepository.php | 43 ++++++++ 2 files changed, 199 insertions(+) create mode 100644 src/Entity/Task.php create mode 100644 src/Repository/TaskRepository.php diff --git a/src/Entity/Task.php b/src/Entity/Task.php new file mode 100644 index 0000000..d630fe6 --- /dev/null +++ b/src/Entity/Task.php @@ -0,0 +1,156 @@ +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; + } +} diff --git a/src/Repository/TaskRepository.php b/src/Repository/TaskRepository.php new file mode 100644 index 0000000..97061ee --- /dev/null +++ b/src/Repository/TaskRepository.php @@ -0,0 +1,43 @@ + + */ +class TaskRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Task::class); + } + + // /** + // * @return Task[] Returns an array of Task objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('t') + // ->andWhere('t.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('t.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Task + // { + // return $this->createQueryBuilder('t') + // ->andWhere('t.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +}