WIP: Implement profile editing

This commit is contained in:
Björn Fromme
2023-10-02 15:07:02 +02:00
parent 953aa9c8e0
commit d3a0021b7d
12 changed files with 311 additions and 47 deletions
+12 -1
View File
@@ -86,7 +86,7 @@ class Teamer implements TimestampableEntityInterface
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Availability::class)]
private Collection $availabilities;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[ORM\OneToOne(cascade: ['persist', 'remove'], fetch: 'EAGER')]
#[Assert\NotNull(message: 'Bitte lade ein Foto von dir hoch', groups: ['profile', 'profile_preflight'])]
private ?Upload $photo = null;
@@ -465,6 +465,17 @@ class Teamer implements TimestampableEntityInterface
return $this;
}
public function hasTraining(Training $training): bool
{
foreach ($this->getTrainingAttendances() as $attendance) {
if ($attendance->getTraining() === $training) {
return true;
}
}
return false;
}
/**
* @return Collection<int, License>
*/