feat: exclude unavailable assignments from list for teamer
This commit is contained in:
@@ -350,6 +350,19 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this->applications;
|
||||
}
|
||||
|
||||
public function getApplicationByTeamer(Teamer $teamer): ?Application
|
||||
{
|
||||
$applications = $this->applications->filter(function (Application $application) use ($teamer) {
|
||||
return $application->getTeamer() === $teamer;
|
||||
});
|
||||
|
||||
if (0 === count($applications)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $applications->first();
|
||||
}
|
||||
|
||||
public function getValidApplications(): Collection
|
||||
{
|
||||
return $this->applications->filter(function (Application $application) {
|
||||
|
||||
Reference in New Issue
Block a user