1 | <?php |
||
27 | final class QueryChecker |
||
28 | { |
||
29 | private function __construct() |
||
32 | |||
33 | /** |
||
34 | * Determines whether the query builder uses a HAVING clause. |
||
35 | * |
||
36 | * @param QueryBuilder $queryBuilder |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | public static function hasHavingClause(QueryBuilder $queryBuilder): bool |
||
44 | |||
45 | /** |
||
46 | * Determines whether the query builder has any root entity with foreign key identifier. |
||
47 | * |
||
48 | * @param QueryBuilder $queryBuilder |
||
49 | * @param ManagerRegistry $managerRegistry |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public static function hasRootEntityWithForeignKeyIdentifier(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): bool |
||
57 | |||
58 | /** |
||
59 | * Determines whether the query builder has any composite identifier. |
||
60 | * |
||
61 | * @param QueryBuilder $queryBuilder |
||
62 | * @param ManagerRegistry $managerRegistry |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public static function hasRootEntityWithCompositeIdentifier(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): bool |
||
70 | |||
71 | /** |
||
72 | * Detects if the root entity has the given identifier. |
||
73 | * |
||
74 | * @param QueryBuilder $queryBuilder |
||
75 | * @param ManagerRegistry $managerRegistry |
||
76 | * @param bool $isForeign |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | private static function hasRootEntityWithIdentifier(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry, bool $isForeign): bool |
||
94 | |||
95 | /** |
||
96 | * Determines whether the query builder has the maximum number of results specified. |
||
97 | * |
||
98 | * @param QueryBuilder $queryBuilder |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public static function hasMaxResults(QueryBuilder $queryBuilder): bool |
||
106 | |||
107 | /** |
||
108 | * Determines whether the query builder has ORDER BY on entity joined through |
||
109 | * to-many association. |
||
110 | * |
||
111 | * @param QueryBuilder $queryBuilder |
||
112 | * @param ManagerRegistry $managerRegistry |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | public static function hasOrderByOnToManyJoin(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): bool |
||
159 | |||
160 | /** |
||
161 | * Determines whether the query builder already has a left join. |
||
162 | * |
||
163 | * @param QueryBuilder $queryBuilder |
||
164 | * |
||
165 | * @return bool |
||
166 | */ |
||
167 | public static function hasLeftJoin(QueryBuilder $queryBuilder): bool |
||
179 | } |
||
180 |