Skip to content

Commit fd77c34

Browse files
authored
fix: remove simple in ODM attributes (#371)
1 parent 9f6e3a6 commit fd77c34

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/AttributeGenerator/DoctrineMongoDBAttributeGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ public function generatePropertyAttributes(Property $property, string $className
121121
|| CardinalitiesExtractor::CARDINALITY_1_1 === $property->cardinality
122122
|| CardinalitiesExtractor::CARDINALITY_N_0 === $property->cardinality
123123
|| CardinalitiesExtractor::CARDINALITY_N_1 === $property->cardinality) {
124-
return [new Attribute('MongoDB\ReferenceOne', ['targetDocument' => $relationName, 'simple' => true])];
124+
return [new Attribute('MongoDB\ReferenceOne', ['targetDocument' => $relationName])];
125125
}
126126

127127
if (CardinalitiesExtractor::CARDINALITY_0_N === $property->cardinality
128128
|| CardinalitiesExtractor::CARDINALITY_1_N === $property->cardinality
129129
|| CardinalitiesExtractor::CARDINALITY_N_N === $property->cardinality) {
130-
return [new Attribute('MongoDB\ReferenceMany', ['targetDocument' => $relationName, 'simple' => true])];
130+
return [new Attribute('MongoDB\ReferenceMany', ['targetDocument' => $relationName])];
131131
}
132132

133133
return [];

tests/AttributeGenerator/DoctrineMongoDBAttributeGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ public function testGenerateFieldAttributes(): void
147147
$this->generator->generatePropertyAttributes($this->classMap['Vehicle']->getPropertyByName('weight'), 'Vehicle')
148148
);
149149
$this->assertEquals(
150-
[new Attribute('MongoDB\ReferenceOne', ['targetDocument' => 'Person', 'simple' => true])],
150+
[new Attribute('MongoDB\ReferenceOne', ['targetDocument' => 'Person'])],
151151
$this->generator->generatePropertyAttributes($this->classMap['Vehicle']->getPropertyByName('relation'), 'Vehicle')
152152
);
153153
$this->assertEquals(
154-
[new Attribute('MongoDB\ReferenceMany', ['targetDocument' => 'Person', 'simple' => true])],
154+
[new Attribute('MongoDB\ReferenceMany', ['targetDocument' => 'Person'])],
155155
$this->generator->generatePropertyAttributes($this->classMap['Vehicle']->getPropertyByName('relations'), 'Vehicle')
156156
);
157157
}

0 commit comments

Comments
 (0)