WIP: Implement document handling

This commit is contained in:
Björn Fromme
2023-10-12 10:41:31 +02:00
parent 3e7ca7e166
commit 46915955b0
18 changed files with 529 additions and 49 deletions
+28
View File
@@ -76,6 +76,9 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
#[ORM\ManyToMany(targetEntity: Teamer::class, mappedBy: 'bookmarks')]
private Collection $teamers;
#[ORM\ManyToMany(targetEntity: Upload::class)]
private Collection $documents;
public function __construct()
{
$this->uuid = Uuid::v4();
@@ -84,6 +87,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
$this->dispositions = new ArrayCollection();
$this->teamers = new ArrayCollection();
$this->benefits = "Anreise im E&P Reisebus\nUnterkunft\nVerpflegung\nSkipass\n";
$this->documents = new ArrayCollection();
}
public function getId(): ?int
@@ -344,4 +348,28 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
/**
* @return Collection<int, Upload>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Upload $document): static
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
}
return $this;
}
public function removeDocument(Upload $document): static
{
$this->documents->removeElement($document);
return $this;
}
}