diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index 802f30fe5..5fbe6fc72 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -175,9 +175,10 @@ class SchemaValidator } foreach ($class->reflClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $publicAttr) { - $ce[] = "Attribute '".$publicAttr->getName()."' in class '".$class->name."' is marked as public. Make sure you initialize your entities manually" - ." before accessing these properties or you will experience strange behaviour as using public properties will disallow Doctrine to use lazy loading. The Doctrine Team strongly" - ." recommends using protected / private properties on entities only. See the manual for more detailed information."; + if ($publicAttr->isStatic()) { + continue; + } + $ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private or protected. Public fields break lazy-loading."; } if ($ce) {