prevent the validator to stop with an "undefined array index"-error while validating a wrong inversedBy Attribute
This commit is contained in:
parent
93fcb74f9a
commit
f1571aeac3
@ -152,6 +152,7 @@ class SchemaValidator
|
||||
}
|
||||
|
||||
// Verify inverse side/owning side match each other
|
||||
if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) {
|
||||
$targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']];
|
||||
if ($assoc['type'] == ClassMetadataInfo::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_ONE){
|
||||
$ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " .
|
||||
@ -164,6 +165,7 @@ class SchemaValidator
|
||||
"side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($assoc['isOwningSide']) {
|
||||
if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user