feat: treat all uploads of type 'document' as global
This commit is contained in:
1 parent
5ad7bfe769
commit
4be039e482
12 files changed
+15
-130
No files matched your search
@@ -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()
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user