the job of this loop should be done by the repository : 
```php
$repo->getRegistrationsGroupedByUsers($user, $collections[]);
```