Skip to content

Commit

Permalink
Remove simple references leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
malarzm authored and alcaeus committed Dec 19, 2017
1 parent a647241 commit 5aa958a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ final class ReferenceMany extends AbstractField
{
public $type = 'many';
public $reference = true;
public $simple = false; // @deprecated
public $storeAs = ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF_WITH_DB;
public $targetDocument;
public $discriminatorField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ final class ReferenceOne extends AbstractField
{
public $type = 'one';
public $reference = true;
public $simple = false; // @deprecated
public $storeAs = ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF_WITH_DB;
public $targetDocument;
public $discriminatorField;
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,16 +1378,6 @@ public function mapField(array $mapping)
$mapping['nullable'] = false;
}

// Synchronize the "simple" and "storeAs" mapping information for backwards compatibility
if (isset($mapping['simple']) && ($mapping['simple'] === true || $mapping['simple'] === 'true')) {
$mapping['storeAs'] = ClassMetadataInfo::REFERENCE_STORE_AS_ID;
@trigger_error('"simple" attribute of a reference is deprecated - use storeAs="id" instead.', E_USER_DEPRECATED);
}
// Provide the correct value for the "simple" field for backwards compatibility
if (isset($mapping['storeAs'])) {
$mapping['simple'] = $mapping['storeAs'] === ClassMetadataInfo::REFERENCE_STORE_AS_ID;
}

if (isset($mapping['reference'])
&& isset($mapping['storeAs'])
&& $mapping['storeAs'] === ClassMetadataInfo::REFERENCE_STORE_AS_ID
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ private function addReferenceMapping(ClassMetadataInfo $class, $reference, $type
'orphanRemoval' => isset($attributes['orphan-removal']) ? ('true' === (string) $attributes['orphan-removal']) : false,
'type' => $type,
'reference' => true,
'simple' => isset($attributes['simple']) ? ('true' === (string) $attributes['simple']) : false, // deprecated
'storeAs' => isset($attributes['store-as']) ? (string) $attributes['store-as'] : ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF_WITH_DB,
'targetDocument' => isset($attributes['target-document']) ? (string) $attributes['target-document'] : null,
'collectionClass' => isset($attributes['collection-class']) ? (string) $attributes['collection-class'] : null,
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/ODM/MongoDB/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ private function addMappingFromReference(ClassMetadataInfo $class, $fieldName, $
'orphanRemoval' => isset($reference['orphanRemoval']) ? $reference['orphanRemoval'] : false,
'type' => $type,
'reference' => true,
'simple' => isset($reference['simple']) ? (boolean) $reference['simple'] : false, // deprecated
'storeAs' => isset($reference['storeAs']) ? (string) $reference['storeAs'] : ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF_WITH_DB,
'targetDocument' => isset($reference['targetDocument']) ? $reference['targetDocument'] : null,
'collectionClass' => isset($reference['collectionClass']) ? $reference['collectionClass'] : null,
Expand Down

0 comments on commit 5aa958a

Please sign in to comment.