-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentsGroupsRepository.php
More file actions
50 lines (44 loc) · 1.09 KB
/
DocumentsGroupsRepository.php
File metadata and controls
50 lines (44 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Created by PhpStorm.
* User: administrator
* Date: 23.08.17
* Time: 12:43
*/
namespace Dsv\PortalBundle\Repository;
use Dsv\PortalBundle\Entity\Portal;
/**
* Class DocumentsGroupsRepository
* @package Dsv\PortalBundle\Repository
*/
class DocumentsGroupsRepository extends AbstractBaseEntityRepository
{
/**
* Base Query Builder for all queries
*
* @return \Doctrine\ORM\QueryBuilder
*/
public function getBaseQueryBuilder()
{
return $this->createQueryBuilder('dg');
}
/**
* @param Portal $portal
* @return \Doctrine\ORM\QueryBuilder
*/
public function getAllPortalDocumentGroupsQuery(Portal $portal)
{
return $this->getBaseQueryBuilder()
->where('dg.portal = :portal')
->setParameter('portal', $portal)
->orderBy('dg.position', 'ASC');
}
/**
* @param Portal $portal
* @return array
*/
public function getAllPortalDocumentGroups(Portal $portal)
{
return $this->getAllPortalDocumentGroupsQuery($portal)->getQuery()->getArrayResult();
}
}