Skip to content

Commit

Permalink
Merge pull request #1478 from malarzm/remove-discriminator-fieldname
Browse files Browse the repository at this point in the history
[2.0] Remove DiscriminatorField's name and fieldName
  • Loading branch information
malarzm authored Aug 5, 2016
2 parents 50605d6 + d7004b1 commit a000a45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,4 @@
*/
final class DiscriminatorField extends Annotation
{
/**
* Available for BC, but AnnotationDriver will consider $value first.
*
* @deprecated property was deprecated in 1.2 and will be removed in 2.0
*/
public $name;

/**
* Available for BC, but AnnotationDriver will consider $name and $value
* first.
*
* @deprecated property was deprecated in 1.0.0-BETA10 and will be removed in 2.0
*/
public $fieldName;
}
9 changes: 1 addition & 8 deletions lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,7 @@ public function loadMetadataForClass($className, ClassMetadata $class)
} elseif ($annot instanceof ODM\InheritanceType) {
$class->setInheritanceType(constant(MappingClassMetadata::class . '::INHERITANCE_TYPE_'.$annot->value));
} elseif ($annot instanceof ODM\DiscriminatorField) {
// $fieldName property is deprecated, but fall back for BC
if (isset($annot->value)) {
$class->setDiscriminatorField($annot->value);
} elseif (isset($annot->name)) {
$class->setDiscriminatorField($annot->name);
} elseif (isset($annot->fieldName)) {
$class->setDiscriminatorField($annot->fieldName);
}
$class->setDiscriminatorField($annot->value);
} elseif ($annot instanceof ODM\DiscriminatorMap) {
$class->setDiscriminatorMap($annot->value);
} elseif ($annot instanceof ODM\DiscriminatorValue) {
Expand Down

0 comments on commit a000a45

Please sign in to comment.