You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function setDiscriminatorField($discriminatorField)
{
if ( ! isset($discriminatorField['name']) && isset($discriminatorField['fieldName'])) {
$discriminatorField['name'] = $discriminatorField['fieldName'];
}
if (isset($this->fieldMappings[$discriminatorField['name']])) {
throw MongoDBException::duplicateFieldMapping($this->name, $discriminatorField['name']);
}
$this->discriminatorField = $discriminatorField;
}
Based on how annotations are loaded, the discriminator annotations are processed at the class doc-block level and presumably before any field-level annotations. Therefore, I don't think any field mappings would exist at the time this method is called.
Perhaps it's more relevant for metadata defined in PHP, XML, and YAML?
The example in the annotations reference actually has a field mapping declared on the property corresponding to the discriminator field. That's the very thing I expect would trigger this exception, if the same example was ported to XML or YAML.
The text was updated successfully, but these errors were encountered:
We have this method in
ClassMetadataInfo
:Based on how annotations are loaded, the discriminator annotations are processed at the class doc-block level and presumably before any field-level annotations. Therefore, I don't think any field mappings would exist at the time this method is called.
Perhaps it's more relevant for metadata defined in PHP, XML, and YAML?
The example in the annotations reference actually has a field mapping declared on the property corresponding to the discriminator field. That's the very thing I expect would trigger this exception, if the same example was ported to XML or YAML.
The text was updated successfully, but these errors were encountered: