From 3c1fd9a3a95bfa245650bd33e77c4e12b2a5cc86 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Mon, 29 Jul 2013 00:35:56 +0300 Subject: [PATCH] Skip not mapped public properties in SchemaValidator --- lib/Doctrine/ORM/Tools/SchemaValidator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index 958e411b6..889297ce8 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -241,6 +241,11 @@ class SchemaValidator continue; } + if ( ! isset($class->fieldMappings[$publicAttr->getName()]) && + ! isset($class->associationMappings[$publicAttr->getName()])) { + continue; + } + $ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private ". "or protected. Public fields may break lazy-loading."; }