DDC-596 - Added validation of inheritance hierachies
This commit is contained in:
parent
aa6edb7903
commit
c0d26b97dd
@ -178,7 +178,15 @@ class SchemaValidator
|
||||
if ($publicAttr->isStatic()) {
|
||||
continue;
|
||||
}
|
||||
$ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private or protected. Public fields break lazy-loading.";
|
||||
$ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private ".
|
||||
"or protected. Public fields may break lazy-loading.";
|
||||
}
|
||||
|
||||
foreach ($class->subClasses AS $subClass) {
|
||||
if (!in_array($class->name, class_parents($subClass))) {
|
||||
$ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ".
|
||||
"of '" . $class->name . "' but these entities are not related through inheritance.";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ce) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user