1 | <?php |
||
14 | class SpecificationRepository extends EntityRepository |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $dqlAlias = 'e'; |
||
20 | |||
21 | /** |
||
22 | * Get the query after matching with given specification. |
||
23 | * |
||
24 | * @param SpecificationInterface $specification |
||
25 | * @param ModifierInterface $modifier |
||
26 | * |
||
27 | * @throws LogicException |
||
28 | * |
||
29 | * @return Query |
||
30 | */ |
||
31 | public function match(SpecificationInterface $specification, ModifierInterface $modifier = null) |
||
45 | |||
46 | /** |
||
47 | * Get the query for a "SELECT COUNT(e) FROM entityName" after matching with given specification. |
||
48 | * |
||
49 | * @param SpecificationInterface $specification |
||
50 | * @param ModifierInterface $modifier |
||
51 | * |
||
52 | * @throws LogicException |
||
53 | * |
||
54 | * @return Query |
||
55 | */ |
||
56 | public function countMatching(SpecificationInterface $specification, ModifierInterface $modifier = null) |
||
73 | |||
74 | /** |
||
75 | * Modifies the QueryBuilder according to the passed Specification. |
||
76 | * Will also set the condition for this query if needed. |
||
77 | * |
||
78 | * @param QueryBuilder $queryBuilder |
||
79 | * @param SpecificationInterface $specification |
||
80 | * |
||
81 | * @internal param string $dqlAlias |
||
82 | */ |
||
83 | private function modifyQueryBuilder(QueryBuilder $queryBuilder, SpecificationInterface $specification) |
||
93 | |||
94 | /** |
||
95 | * Modifies and returns a Query object according to the (optional) result modifier. |
||
96 | * |
||
97 | * @param QueryBuilder $queryBuilder |
||
98 | * @param ModifierInterface|null $modifier |
||
99 | * |
||
100 | * @return Query |
||
101 | */ |
||
102 | private function modifyQuery(QueryBuilder $queryBuilder, ModifierInterface $modifier = null) |
||
112 | } |
||
113 |