feat: treat all uploads of type 'document' as global

This commit is contained in:
Björn Fromme committed 2024-01-31 18:05:56 +01:00
1 parent 5ad7bfe769
commit 4be039e482
12 files changed
+15 -130

No files matched your search

+10 -14
View File
@@ -25,7 +25,7 @@ class UploadRepository extends ServiceEntityRepository
parent::__construct($registry, Upload::class);
}
public function getDocumentListQuery(): Query
public function getGlobalListQuery(): Query
{
$qb = $this->createQueryBuilder('upload');
@@ -36,6 +36,15 @@ class UploadRepository extends ServiceEntityRepository
;
}
public function getGlobal(): array
{
return $this
->getGlobalListQuery()
->getResult()
;
}
public function getAutocompletionData(string $search): array
{
$qb = $this->createQueryBuilder('upload');
@@ -123,17 +132,4 @@ 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()
;
}
}