mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
36 lines
862 B
PHP
36 lines
862 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\Model\Repositories;
|
|
|
|
use Alchemy\Phrasea\Model\Entities\WorkerRunningUploader;
|
|
use Doctrine\ORM\EntityRepository;
|
|
|
|
class WorkerRunningUploaderRepository extends EntityRepository
|
|
{
|
|
public function getEntityManager()
|
|
{
|
|
return parent::getEntityManager();
|
|
}
|
|
|
|
/**
|
|
* @param $commitId
|
|
* @return bool
|
|
*/
|
|
public function canAck($commitId)
|
|
{
|
|
$qb = $this->createQueryBuilder('w');
|
|
$res = $qb
|
|
->where('w.commitId = :commitId')
|
|
->andWhere('w.status != :status')
|
|
->setParameters([
|
|
'commitId' => $commitId,
|
|
'status' => WorkerRunningUploader::DOWNLOADED
|
|
])
|
|
->getQuery()
|
|
->getResult()
|
|
;
|
|
|
|
return count($res) == 0;
|
|
}
|
|
}
|