Total Complexity | 3 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | trait Repository |
||
14 | { |
||
15 | /** |
||
16 | * Returns the AclFilter to fetch ACL filtering SQL |
||
17 | * |
||
18 | * @return AclFilter |
||
19 | */ |
||
20 | public function getAclFilter(): AclFilter |
||
21 | { |
||
22 | /** @var AclFilter $aclFilter */ |
||
23 | $aclFilter = $this->getEntityManager()->getFilters()->getFilter(AclFilter::class); |
||
|
|||
24 | |||
25 | return $aclFilter; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Return native SQL query to get all ID |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | protected function getAllIdsQuery(): string |
||
34 | { |
||
35 | $connection = $this->getEntityManager()->getConnection(); |
||
36 | $qb = $connection->createQueryBuilder() |
||
37 | ->select('id') |
||
38 | ->from($connection->quoteIdentifier($this->getClassMetadata()->getTableName())); |
||
39 | |||
40 | return $qb->getSQL(); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Return native SQL query to get all ID of object owned by given user |
||
45 | * |
||
46 | * @param User $user |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | protected function getAllIdsForOwnerQuery(User $user): string |
||
59 | } |
||
60 | } |
||
61 |