From df1250ee4b29456202de17d12d49b3304f35c9e7 Mon Sep 17 00:00:00 2001 From: Guilherme Lopes Date: Thu, 21 Sep 2017 13:42:51 +0200 Subject: [PATCH] Fix negation clause and also adding both conditions in the same if --- lib/Doctrine/ORM/Query/SqlWalker.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index ef072f91b..53a5c7474 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -749,11 +749,8 @@ class SqlWalker implements TreeWalker // Add foreign key columns of class and also parent classes foreach ($class->associationMappings as $assoc) { - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { - continue; - } - - if ( !$addMetaColumns && !isset($assoc['id'])) { + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) + || ( ! $addMetaColumns && !isset($assoc['id']))) { continue; }