|
| __construct (\PDOStatement $objPDO, array $arrQueryDefinition) |
|
create an exception with relevant information, if a query fails
Definition at line 11 of file QueryException.class.php.
DDDBL\QueryException::__construct |
( |
\PDOStatement |
$objPDO, |
|
|
array |
$arrQueryDefinition |
|
) |
| |
- Parameters
-
$objPDO | - the PDO object which caused the error when executed |
$arrQueryDefinition | - the complete query definition |
create an error message which contains all relevant informations and print them as exception
Definition at line 22 of file QueryException.class.php.
24 $strMessage = self::createErrorMessage($objPDO, $arrQueryDefinition);
26 parent::__construct($strMessage);
DDDBL\QueryException::createErrorMessage |
( |
\PDOStatement |
$objPDO, |
|
|
array |
$arrQueryDefinition |
|
) |
| |
|
private |
- Parameters
-
$objPDO | - the PDO object related with the error |
$arrQueryDefinition | - the complete query definition |
- Returns
- (string) the complete exception message
build and return the exception message out of the given error info and query definition
Definition at line 41 of file QueryException.class.php.
43 $strMessage = self::flattenQueryErrorInfo($objPDO);
44 $strMessage .= self::flattenQueryDefiniton($arrQueryDefinition);
DDDBL\QueryException::flattenQueryDefiniton |
( |
array |
$arrQueryDefinition | ) |
|
|
private |
- Parameters
-
$arrQueryDefinition | - the complete query definition |
- Returns
- (string) a text version of the query definition
create an text, which contains all scalar information of the query definition. if there are non-scalar information added, the will be excluded from output
Definition at line 84 of file QueryException.class.php.
86 $strMessage =
"\nQuery-Definiton:\n";
88 foreach($arrQueryDefinition AS $strKeyword => $strContent)
89 if(is_scalar($strContent))
90 $strMessage .=
"$strKeyword: $strContent\n";
92 return $strMessage .
"\n";
DDDBL\QueryException::flattenQueryErrorInfo |
( |
\PDOStatement |
$objPDO | ) |
|
|
private |
- Parameters
-
$objPDO | - PDO object to get error information from |
- Returns
- (string) a flatten error info from the query object
build and return a flatten error-info from the driver specific error message
Definition at line 60 of file QueryException.class.php.
62 $arrErrorInfo = $objPDO->errorInfo();
66 if(!empty($arrErrorInfo) && !empty($arrErrorInfo[0]) &&
'00000' !== $arrErrorInfo[0])
67 $strMessage =
"\nError-Code: {$arrErrorInfo[0]}\nError-Message: {$arrErrorInfo[2]}\n";
The documentation for this class was generated from the following file: