1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Updated message and added behaviour for public static vars

Signed-off-by: David Abdemoulaie <dave@hobodave.com>
This commit is contained in:
Christian Heinrich 2010-05-20 23:50:59 +02:00 committed by David Abdemoulaie
parent 773f56bef2
commit 45ec58fc7e

View File

@ -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) {