1 | <?php |
||
26 | class DBALException extends \Exception |
||
27 | { |
||
28 | /** |
||
29 | * @param string $method |
||
30 | * |
||
31 | * @return \Doctrine\DBAL\DBALException |
||
32 | */ |
||
33 | 49 | public static function notSupported($method) |
|
37 | |||
38 | /** |
||
39 | * @return \Doctrine\DBAL\DBALException |
||
40 | */ |
||
41 | public static function invalidPlatformSpecified() |
||
47 | |||
48 | /** |
||
49 | * Returns a new instance for an invalid specified platform version. |
||
50 | * |
||
51 | * @param string $version The invalid platform version given. |
||
52 | * @param string $expectedFormat The expected platform version format. |
||
53 | * |
||
54 | * @return DBALException |
||
55 | */ |
||
56 | 10 | public static function invalidPlatformVersionSpecified($version, $expectedFormat) |
|
67 | |||
68 | /** |
||
69 | * @return \Doctrine\DBAL\DBALException |
||
70 | */ |
||
71 | 1 | public static function invalidPdoInstance() |
|
78 | |||
79 | /** |
||
80 | * @param string|null $url The URL that was provided in the connection parameters (if any). |
||
81 | * |
||
82 | * @return \Doctrine\DBAL\DBALException |
||
83 | */ |
||
84 | 5 | public static function driverRequired($url = null) |
|
99 | |||
100 | /** |
||
101 | * @param string $unknownDriverName |
||
102 | * @param array $knownDrivers |
||
103 | * |
||
104 | * @return \Doctrine\DBAL\DBALException |
||
105 | */ |
||
106 | 1 | public static function unknownDriver($unknownDriverName, array $knownDrivers) |
|
111 | |||
112 | /** |
||
113 | * @param \Doctrine\DBAL\Driver $driver |
||
114 | * @param \Exception $driverEx |
||
115 | * @param string $sql |
||
116 | * @param array $params |
||
117 | * |
||
118 | * @return \Doctrine\DBAL\DBALException |
||
119 | */ |
||
120 | 69 | public static function driverExceptionDuringQuery(Driver $driver, \Exception $driverEx, $sql, array $params = array()) |
|
130 | |||
131 | /** |
||
132 | * @param \Doctrine\DBAL\Driver $driver |
||
133 | * @param \Exception $driverEx |
||
134 | * |
||
135 | * @return \Doctrine\DBAL\DBALException |
||
136 | */ |
||
137 | 1 | public static function driverException(Driver $driver, \Exception $driverEx) |
|
141 | |||
142 | /** |
||
143 | * @param \Doctrine\DBAL\Driver $driver |
||
144 | * @param \Exception $driverEx |
||
145 | * |
||
146 | * @return \Doctrine\DBAL\DBALException |
||
147 | */ |
||
148 | 70 | private static function wrapException(Driver $driver, \Exception $driverEx, $msg) |
|
159 | |||
160 | /** |
||
161 | * Returns a human-readable representation of an array of parameters. |
||
162 | * This properly handles binary data by returning a hex representation. |
||
163 | * |
||
164 | * @param array $params |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | private static function formatParameters(array $params) |
||
181 | |||
182 | /** |
||
183 | * @param string $wrapperClass |
||
184 | * |
||
185 | * @return \Doctrine\DBAL\DBALException |
||
186 | */ |
||
187 | 1 | public static function invalidWrapperClass($wrapperClass) |
|
192 | |||
193 | /** |
||
194 | * @param string $driverClass |
||
195 | * |
||
196 | * @return \Doctrine\DBAL\DBALException |
||
197 | */ |
||
198 | 1 | public static function invalidDriverClass($driverClass) |
|
203 | |||
204 | /** |
||
205 | * @param string $tableName |
||
206 | * |
||
207 | * @return \Doctrine\DBAL\DBALException |
||
208 | */ |
||
209 | 1 | public static function invalidTableName($tableName) |
|
213 | |||
214 | /** |
||
215 | * @param string $tableName |
||
216 | * |
||
217 | * @return \Doctrine\DBAL\DBALException |
||
218 | */ |
||
219 | 16 | public static function noColumnsSpecifiedForTable($tableName) |
|
223 | |||
224 | /** |
||
225 | * @return \Doctrine\DBAL\DBALException |
||
226 | */ |
||
227 | public static function limitOffsetInvalid() |
||
231 | |||
232 | /** |
||
233 | * @param string $name |
||
234 | * |
||
235 | * @return \Doctrine\DBAL\DBALException |
||
236 | */ |
||
237 | public static function typeExists($name) |
||
241 | |||
242 | /** |
||
243 | * @param string $name |
||
244 | * |
||
245 | * @return \Doctrine\DBAL\DBALException |
||
246 | */ |
||
247 | public static function unknownColumnType($name) |
||
248 | { |
||
249 | return new self('Unknown column type "'.$name.'" requested. Any Doctrine type that you use has ' . |
||
250 | 'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the ' . |
||
251 | 'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database ' . |
||
252 | 'introspection then you might have forgotten to register all database types for a Doctrine Type. Use ' . |
||
253 | 'AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement ' . |
||
254 | 'Type#getMappedDatabaseTypes(). If the type name is empty you might ' . |
||
255 | 'have a problem with the cache or forgot some mapping information.' |
||
256 | ); |
||
257 | } |
||
258 | |||
259 | /** |
||
260 | * @param string $name |
||
261 | * |
||
262 | * @return \Doctrine\DBAL\DBALException |
||
263 | */ |
||
264 | 16 | public static function typeNotFound($name) |
|
268 | } |
||
269 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: