create exports via command (#3605)

This commit is contained in:
Kevin Papst
2022-10-29 18:20:19 +02:00
committed by GitHub
parent 0461539f4b
commit d58720252e
11 changed files with 667 additions and 17 deletions

View File

@@ -69,6 +69,26 @@ class UserRepository extends EntityRepository implements UserLoaderInterface
return $user;
}
/**
* @param int[] $userIds
* @return User[]
*/
public function findByIds(array $userIds): array
{
$qb = $this->createQueryBuilder('u');
$qb
->where($qb->expr()->in('u.id', ':id'))
->setParameter('id', $userIds)
;
$users = $qb->getQuery()->getResult();
$loader = new UserLoader($qb->getEntityManager(), true);
$loader->loadResults($users);
return $users;
}
/**
* Overwritten to fetch preferences when using the Profile controller actions.
* Depends on the query, some magic mechanisms like the ParamConverter will use this method to fetch the user.