|
@@ 120-132 (lines=13) @@
|
| 117 |
|
$ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
| 118 |
|
"field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association, but as field."; |
| 119 |
|
} |
| 120 |
|
if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { |
| 121 |
|
$ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
| 122 |
|
"field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; |
| 123 |
|
} elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { |
| 124 |
|
$ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". |
| 125 |
|
"bi-directional relationship, but the specified mappedBy association on the target-entity ". |
| 126 |
|
$assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
| 127 |
|
"'inversedBy=\"" . $fieldName . "\"' attribute."; |
| 128 |
|
} elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { |
| 129 |
|
$ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
| 130 |
|
$assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". |
| 131 |
|
"inconsistent with each other."; |
| 132 |
|
} |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
if ($assoc['inversedBy']) { |
|
@@ 141-153 (lines=13) @@
|
| 138 |
|
"field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { |
| 142 |
|
$ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
| 143 |
|
"field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; |
| 144 |
|
} elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { |
| 145 |
|
$ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". |
| 146 |
|
"bi-directional relationship, but the specified mappedBy association on the target-entity ". |
| 147 |
|
$assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
| 148 |
|
"'inversedBy' attribute."; |
| 149 |
|
} elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { |
| 150 |
|
$ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
| 151 |
|
$assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". |
| 152 |
|
"inconsistent with each other."; |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
// Verify inverse side/owning side match each other |
| 156 |
|
if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { |