mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
order accompanying course by openingDate for Person
This commit is contained in:
parent
efbd9b0185
commit
50a2de1559
@ -222,6 +222,10 @@ class AccompanyingPeriodController extends AbstractController
|
||||
$accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository
|
||||
->findByPerson($person, AccompanyingPeriodVoter::SEE);
|
||||
|
||||
usort($accompanyingPeriodsRaw, static function ($a, $b) {
|
||||
return $b->getOpeningDate() > $a->getOpeningDate();
|
||||
});
|
||||
|
||||
// filter visible or not visible
|
||||
$accompanyingPeriods = array_filter($accompanyingPeriodsRaw, function (AccompanyingPeriod $ap) {
|
||||
return $this->isGranted(AccompanyingPeriodVoter::SEE, $ap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user