WIP: Improve assignment information display
This commit is contained in:
1 parent
21968b833c
commit
585f86e45f
15 files changed
+84
-55
No files matched your search
@@ -117,4 +117,30 @@ class Application implements TimestampableEntityInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function matchesPickup(): bool
|
||||
{
|
||||
if (0 === $pickupId = (int) $this->getAssignment()->getPickup()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$teamer = $this->getTeamer();
|
||||
|
||||
return $teamer->hasPickup($pickupId);
|
||||
}
|
||||
|
||||
public function getCompletedTrainingsCount(): int
|
||||
{
|
||||
$count = 0;
|
||||
$requiredTrainings = $this->getAssignment()->getJobProfile()->getRequiredTrainings();
|
||||
$teamer = $this->getTeamer();
|
||||
|
||||
foreach ($requiredTrainings as $requiredTraining) {
|
||||
if ($teamer->getTrainingAttendance($requiredTraining)) {
|
||||
++$count;
|
||||
}
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user