Skip to content

Commit

Permalink
Favour int over int_id
Browse files Browse the repository at this point in the history
  • Loading branch information
malarzm committed May 18, 2020
1 parent 33bd049 commit 9e0b1a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ public function mapField(array $mapping) : array
if (! empty($this->generatorOptions['type'])) {
$mapping['type'] = $this->generatorOptions['type'];
} elseif (empty($mapping['type'])) {
$mapping['type'] = $this->generatorType === self::GENERATOR_TYPE_INCREMENT ? 'int_id' : 'custom_id';
$mapping['type'] = $this->generatorType === self::GENERATOR_TYPE_INCREMENT ? Type::INT : Type::CUSTOMID;
}
}
unset($this->generatorOptions['type']);
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ class NotifyChangedDocument implements NotifyPropertyChanged
{
private $_listeners = [];

/** @ODM\Id(type="int_id", strategy="none") */
/** @ODM\Id(type="int", strategy="none") */
private $id;

/** @ODM\Field(type="string") */
Expand Down Expand Up @@ -611,7 +611,7 @@ protected function _onPropertyChanged($propName, $oldValue, $newValue)
/** @ODM\Document */
class NotifyChangedRelatedItem
{
/** @ODM\Id(type="int_id", strategy="none") */
/** @ODM\Id(type="int", strategy="none") */
private $id;

/** @ODM\ReferenceOne(targetDocument=NotifyChangedDocument::class) */
Expand Down

0 comments on commit 9e0b1a1

Please sign in to comment.