-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordonnancer l'affichage des créneaux des membres #625
Conversation
src/AppBundle/Entity/Membership.php
Outdated
return $a->getStart() < $b->getStart(); // DESC (default $beneficiary->shifts order) | ||
}); | ||
$shifts = new ArrayCollection(iterator_to_array($iterator)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On ne pourrait pas le faire plus proprement en faisant une requête doctrine dans le repository (cf ShiftRepository) ?
Enchainer les 2 foreach + l'iterateur + le filter (si on ignore les dismissed), c'est pas très beau non ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis d'accord qu'en le faisant je n'ai pas trouvé ça très beau... Comme on fait une requête qui agrège plusieurs bénéficiaires, ca demanderait en effet de ré-architecturer la requête, là les repository ca dépasse mes compétences actuelles ^^
@raphodn tu as pu regarder mon commit ? |
0090de9
to
0fdf08f
Compare
Désolé je n'avais pas vu. Et trop compliqué pour moi je te laisse gérer ^^ |
* Order all of the members displayed shifts by latest first * Order beneficiary period positions by dayofweek/start * Refactor getAllShifts membership to leverage DB filtering and sorting functionalities Co-authored-by: Albin PETIT <[email protected]>
Quoi ?
Lorsqu'un bénéficiaire souhaite afficher ses créneaux, ils sont ordonnés par le "plus récent d'abord".
Mais :
Captures d'écran