create exports via command (#3605)
This commit is contained in:
@@ -57,6 +57,26 @@ class CustomerRepository extends EntityRepository
|
||||
return $customer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $customerIDs
|
||||
* @return Customer[]
|
||||
*/
|
||||
public function findByIds(array $customerIDs): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('c');
|
||||
$qb
|
||||
->where($qb->expr()->in('c.id', ':id'))
|
||||
->setParameter('id', $customerIDs)
|
||||
;
|
||||
|
||||
$customers = $qb->getQuery()->getResult();
|
||||
|
||||
$loader = new CustomerLoader($qb->getEntityManager(), true);
|
||||
$loader->loadResults($customers);
|
||||
|
||||
return $customers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Customer $customer
|
||||
* @throws ORMException
|
||||
|
||||
@@ -54,6 +54,26 @@ class TeamRepository extends EntityRepository
|
||||
return $team;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $teamIds
|
||||
* @return Team[]
|
||||
*/
|
||||
public function findByIds(array $teamIds): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('t');
|
||||
$qb
|
||||
->where($qb->expr()->in('t.id', ':id'))
|
||||
->setParameter('id', $teamIds)
|
||||
;
|
||||
|
||||
$teams = $qb->getQuery()->getResult();
|
||||
|
||||
$loader = new TeamLoader($qb->getEntityManager());
|
||||
$loader->loadResults($teams);
|
||||
|
||||
return $teams;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Team $team
|
||||
* @throws ORMException
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user