Updated message and added behaviour for public static vars
Signed-off-by: David Abdemoulaie <dave@hobodave.com>
This commit is contained in:
parent
773f56bef2
commit
45ec58fc7e
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user