feat : add TaskDocument entity with Task relation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 18:03:20 +01:00
parent a36cd92a7f
commit cfaa6c42ec
2 changed files with 177 additions and 1 deletions

View File

@@ -99,9 +99,15 @@ class Task
#[Groups(['task:read', 'task:write'])]
private bool $archived = false;
/** @var Collection<int, TaskDocument> */
#[ORM\OneToMany(targetEntity: TaskDocument::class, mappedBy: 'task', cascade: ['remove'])]
#[Groups(['task:read'])]
private Collection $documents;
public function __construct()
{
$this->tags = new ArrayCollection();
$this->tags = new ArrayCollection();
$this->documents = new ArrayCollection();
}
public function getId(): ?int
@@ -250,4 +256,10 @@ class Task
return $this;
}
/** @return Collection<int, TaskDocument> */
public function getDocuments(): Collection
{
return $this->documents;
}
}