1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Add path expresion to QueryException::associationPathInverseSideNotSupported()

This commit is contained in:
Tomasz Darmetko 2017-03-06 19:39:27 +01:00 committed by Marco Pivetta
parent 33cee11e6f
commit 633a442046
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629
2 changed files with 6 additions and 4 deletions

View File

@ -204,13 +204,15 @@ class QueryException extends \Doctrine\ORM\ORMException
} }
/** /**
* @param object $pathExpr
*
* @return QueryException * @return QueryException
*/ */
public static function associationPathInverseSideNotSupported() public static function associationPathInverseSideNotSupported($pathExpr)
{ {
return new self( return new self(
"A single-valued association path expression to an inverse side is not supported". "A single-valued association path expression to an inverse side is not supported in DQL queries. " .
" in DQL queries. Use an explicit join instead." "Instead of '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "' use an explicit join."
); );
} }

View File

@ -671,7 +671,7 @@ class SqlWalker implements TreeWalker
$assoc = $class->associationMappings[$fieldName]; $assoc = $class->associationMappings[$fieldName];
if ( ! $assoc['isOwningSide']) { if ( ! $assoc['isOwningSide']) {
throw QueryException::associationPathInverseSideNotSupported(); throw QueryException::associationPathInverseSideNotSupported($pathExpr);
} }
// COMPOSITE KEYS NOT (YET?) SUPPORTED // COMPOSITE KEYS NOT (YET?) SUPPORTED