mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
@@ -379,11 +379,20 @@ class WorkerRunningJobRepository extends EntityRepository
|
||||
return count($qb->getQuery()->getResult());
|
||||
}
|
||||
|
||||
public function findByStatus(array $status, $start = 0, $limit = WorkerRunningJob::MAX_RESULT)
|
||||
public function findByStatusAndJob(array $status, $jobType, $start = 0, $limit = WorkerRunningJob::MAX_RESULT)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('w');
|
||||
|
||||
if (!empty($status)) {
|
||||
$qb->where($qb->expr()->in('w.status', $status));
|
||||
}
|
||||
|
||||
if (!empty($jobType)) {
|
||||
$qb->andWhere('w.work = :work')
|
||||
->setParameter('work', $jobType);
|
||||
}
|
||||
|
||||
$qb
|
||||
->where($qb->expr()->in('w.status', $status))
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
->orderBy('w.id', 'DESC')
|
||||
|
Reference in New Issue
Block a user