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