1 | <?php |
||
32 | class QueryException extends \Doctrine\ORM\ORMException |
||
33 | { |
||
34 | /** |
||
35 | * @param string $dql |
||
36 | * |
||
37 | * @return QueryException |
||
38 | */ |
||
39 | 49 | public static function dqlError($dql) |
|
43 | |||
44 | /** |
||
45 | * @param string $message |
||
46 | * @param \Exception|null $previous |
||
47 | * |
||
48 | * @return QueryException |
||
49 | */ |
||
50 | 17 | public static function syntaxError($message, $previous = null) |
|
54 | |||
55 | /** |
||
56 | * @param string $message |
||
57 | * @param \Exception|null $previous |
||
58 | * |
||
59 | * @return QueryException |
||
60 | */ |
||
61 | 33 | public static function semanticalError($message, $previous = null) |
|
65 | |||
66 | /** |
||
67 | * @return QueryException |
||
68 | */ |
||
69 | public static function invalidLockMode() |
||
70 | { |
||
71 | return new self('Invalid lock mode hint provided.'); |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @param string $expected |
||
76 | * @param string $received |
||
77 | * |
||
78 | * @return QueryException |
||
79 | */ |
||
80 | public static function invalidParameterType($expected, $received) |
||
81 | { |
||
82 | return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * @param string $pos |
||
87 | * |
||
88 | * @return QueryException |
||
89 | */ |
||
90 | public static function invalidParameterPosition($pos) |
||
91 | { |
||
92 | return new self('Invalid parameter position: ' . $pos); |
||
93 | } |
||
94 | |||
95 | /** |
||
96 | * @param integer $expected |
||
97 | * @param integer $received |
||
98 | * |
||
99 | * @return QueryException |
||
100 | */ |
||
101 | 1 | public static function tooManyParameters($expected, $received) |
|
105 | |||
106 | /** |
||
107 | * @param integer $expected |
||
108 | * @param integer $received |
||
109 | * |
||
110 | * @return QueryException |
||
111 | */ |
||
112 | 1 | public static function tooFewParameters($expected, $received) |
|
116 | |||
117 | /** |
||
118 | * @param string $value |
||
119 | * |
||
120 | * @return QueryException |
||
121 | */ |
||
122 | 2 | public static function invalidParameterFormat($value) |
|
126 | |||
127 | /** |
||
128 | * @param string $key |
||
129 | * |
||
130 | * @return QueryException |
||
131 | */ |
||
132 | 1 | public static function unknownParameter($key) |
|
136 | |||
137 | /** |
||
138 | * @return QueryException |
||
139 | */ |
||
140 | public static function parameterTypeMismatch() |
||
141 | { |
||
142 | return new self("DQL Query parameter and type numbers mismatch, but have to be exactly equal."); |
||
143 | } |
||
144 | |||
145 | /** |
||
146 | * @param object $pathExpr |
||
147 | * |
||
148 | * @return QueryException |
||
149 | */ |
||
150 | public static function invalidPathExpression($pathExpr) |
||
151 | { |
||
152 | return new self( |
||
153 | "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
||
154 | ); |
||
155 | } |
||
156 | |||
157 | /** |
||
158 | * @param string $literal |
||
159 | * |
||
160 | * @return QueryException |
||
161 | */ |
||
162 | public static function invalidLiteral($literal) |
||
163 | { |
||
164 | return new self("Invalid literal '$literal'"); |
||
165 | } |
||
166 | |||
167 | /** |
||
168 | * @param array $assoc |
||
169 | * |
||
170 | * @return QueryException |
||
171 | */ |
||
172 | public static function iterateWithFetchJoinCollectionNotAllowed($assoc) |
||
173 | { |
||
174 | return new self( |
||
175 | "Invalid query operation: Not allowed to iterate over fetch join collections ". |
||
176 | "in class ".$assoc['sourceEntity']." association ".$assoc['fieldName'] |
||
177 | ); |
||
178 | } |
||
179 | |||
180 | /** |
||
181 | * @return QueryException |
||
182 | */ |
||
183 | public static function partialObjectsAreDangerous() |
||
184 | { |
||
185 | return new self( |
||
186 | "Loading partial objects is dangerous. Fetch full objects or consider " . |
||
187 | "using a different fetch mode. If you really want partial objects, " . |
||
188 | "set the doctrine.forcePartialLoad query hint to TRUE." |
||
189 | ); |
||
190 | } |
||
191 | |||
192 | /** |
||
193 | * @param array $assoc |
||
194 | * |
||
195 | * @return QueryException |
||
196 | */ |
||
197 | public static function overwritingJoinConditionsNotYetSupported($assoc) |
||
198 | { |
||
199 | return new self( |
||
200 | "Unsupported query operation: It is not yet possible to overwrite the join ". |
||
201 | "conditions in class ".$assoc['sourceEntityName']." association ".$assoc['fieldName'].". ". |
||
202 | "Use WITH to append additional join conditions to the association." |
||
203 | ); |
||
204 | } |
||
205 | |||
206 | /** |
||
207 | * @return QueryException |
||
208 | */ |
||
209 | 2 | public static function associationPathInverseSideNotSupported() |
|
216 | |||
217 | /** |
||
218 | * @param array $assoc |
||
219 | * |
||
220 | * @return QueryException |
||
221 | */ |
||
222 | 3 | public static function iterateWithFetchJoinNotAllowed($assoc) |
|
229 | |||
230 | /** |
||
231 | * @return QueryException |
||
232 | */ |
||
233 | 1 | public static function associationPathCompositeKeyNotSupported() |
|
241 | |||
242 | /** |
||
243 | * @param string $className |
||
244 | * @param string $rootClass |
||
245 | * |
||
246 | * @return QueryException |
||
247 | */ |
||
248 | 1 | public static function instanceOfUnrelatedClass($className, $rootClass) |
|
253 | |||
254 | /** |
||
255 | * @param string $dqlAlias |
||
256 | * |
||
257 | * @return QueryException |
||
258 | */ |
||
259 | 1 | public static function invalidQueryComponent($dqlAlias) |
|
266 | } |
||
267 |