mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Display registration should use pending Registrations.
fixes PHRAS-551
This commit is contained in:
@@ -49,6 +49,29 @@ class RegistrationRepository extends EntityRepository
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Current pending registrations.
|
||||
*
|
||||
* @param \collection[] $collections
|
||||
* @return Registration[]
|
||||
*/
|
||||
public function getPendingRegistrations(array $collections)
|
||||
{
|
||||
$builder = $this->createQueryBuilder('r');
|
||||
$builder->where('r.pending = 1');
|
||||
|
||||
if (!empty($collections)) {
|
||||
$builder->andWhere('r.baseId IN (:bases)');
|
||||
$builder->setParameter('bases', array_map(function (\collection $collection) {
|
||||
return $collection->get_base_id();
|
||||
}, $collections));
|
||||
}
|
||||
|
||||
$builder->orderBy('r.created', 'DESC');
|
||||
|
||||
return $builder->getQuery()->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets registration registrations for a user.
|
||||
*
|
||||
|
Reference in New Issue
Block a user