Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Remove DiscriminatorField's name and fieldName #1478

Merged
merged 1 commit into from
Aug 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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