WIP: Implement profile editing
This commit is contained in:
+12
-1
@@ -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>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user