feat: mark documents global
This commit is contained in:
1 parent
bd3b3688c5
commit
79a4a8fef5
8 files changed
+105
-15
No files matched your search
@@ -6,7 +6,6 @@ use App\Entity\Upload;
|
||||
use App\Repository\Traits\QueryHelperTrait;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
@@ -124,4 +123,17 @@ class UploadRepository extends ServiceEntityRepository
|
||||
->getSingleScalarResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getGlobal(): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
return $qb
|
||||
->where($qb->expr()->eq('upload.global', ':global'))
|
||||
->setParameter('global', true)
|
||||
->orderBy('upload.createdAt', 'DESC')
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user