feat: mark documents global

This commit is contained in:
Björn Fromme committed 2024-01-28 14:09:02 +01:00
1 parent bd3b3688c5
commit 79a4a8fef5
8 files changed
+105 -15

No files matched your search

+13 -1
View File
@@ -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()
;
}
}