mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into upgrade-php82
This commit is contained in:
@@ -680,6 +680,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
$this->proxyAccompanyingPeriodOpenState = false;
|
||||
}
|
||||
|
||||
public function countResources(): int
|
||||
{
|
||||
return $this->resources->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* This public function is the same but return only true or false.
|
||||
*/
|
||||
@@ -764,6 +769,18 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function countAccompanyingPeriodInvolved(
|
||||
bool $asParticipantOpen = true,
|
||||
bool $asRequestor = true
|
||||
): int {
|
||||
// TODO should be optimized to avoid loading accompanying period ?
|
||||
return $this->getAccompanyingPeriodInvolved($asParticipantOpen, $asRequestor)
|
||||
->filter(function (AccompanyingPeriod $p) {
|
||||
return $p->getStep() !== AccompanyingPeriod::STEP_DRAFT;
|
||||
})
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get AccompanyingPeriodParticipations Collection.
|
||||
*
|
||||
|
Reference in New Issue
Block a user