From e390dbd5baba9726af3ff48d63832ecbb500360e Mon Sep 17 00:00:00 2001 From: oprokidnev Date: Fri, 27 Nov 2015 16:00:56 +0500 Subject: [PATCH] Target entity resolver for DQL Since we have target entity resolver in doctrine this class check is not enought. To gain interface resolution it is better to add interface check in addition to class_check here. --- lib/Doctrine/ORM/Query/Parser.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 6eb897268..8b6feaf83 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -996,9 +996,7 @@ class Parser */ private function validateAbstractSchemaName($schemaName) { - $exists = class_exists($schemaName, true); - - if (! $exists) { + if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); } } @@ -1814,7 +1812,7 @@ class Parser $this->match(Lexer::T_OPEN_CURLY_BRACE); $this->match(Lexer::T_IDENTIFIER); - $field = $this->lexer->token['value']; + $field = $this->lexer->token['value']; // First field in partial expression might be embeddable property while ($this->lexer->isNextToken(Lexer::T_DOT)) {