DDC-127 - Commit missing changes to Query Error handling which make testsuite fail.
This commit is contained in:
parent
3b9fd15dd6
commit
fc98f26371
@ -207,7 +207,16 @@ final class Query extends AbstractQuery
|
|||||||
$sqlParams = array();
|
$sqlParams = array();
|
||||||
|
|
||||||
$paramMappings = $this->_parserResult->getParameterMappings();
|
$paramMappings = $this->_parserResult->getParameterMappings();
|
||||||
|
|
||||||
|
if(count($paramMappings) != count($params)) {
|
||||||
|
throw new QueryException("Invalid parameter number: number of bound variables does not match number of tokens");
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($params as $key => $value) {
|
foreach ($params as $key => $value) {
|
||||||
|
if(!isset($paramMappings[$key])) {
|
||||||
|
throw new QueryException("Invalid parameter: token ".$key." is not defined in the query.");
|
||||||
|
}
|
||||||
|
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
$values = $this->_em->getClassMetadata(get_class($value))->getIdentifierValues($value);
|
$values = $this->_em->getClassMetadata(get_class($value))->getIdentifierValues($value);
|
||||||
$sqlPositions = $paramMappings[$key];
|
$sqlPositions = $paramMappings[$key];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user