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