Skip to content

Commit 7602a53

Browse files
authored
Merge pull request #12224 from greg0ire/3.5.x
Merge 2.20.x up into 3.5.x
2 parents cf11f1e + 214b1ad commit 7602a53

File tree

8 files changed

+17
-40
lines changed

8 files changed

+17
-40
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ on:
2424

2525
jobs:
2626
coding-standards:
27-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@8.0.0"
27+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@10.1.0"

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- "8.2"
3636
- "8.3"
3737
- "8.4"
38+
- "8.5"
3839
dbal-version:
3940
- "default"
4041
- "3.7"
@@ -169,6 +170,7 @@ jobs:
169170
- "8.2"
170171
- "8.3"
171172
- "8.4"
173+
- "8.5"
172174
dbal-version:
173175
- "default"
174176
- "3.7"
@@ -243,6 +245,7 @@ jobs:
243245
- "8.2"
244246
- "8.3"
245247
- "8.4"
248+
- "8.5"
246249
dbal-version:
247250
- "default"
248251
- "3.7"
@@ -310,6 +313,7 @@ jobs:
310313
- "8.2"
311314
- "8.3"
312315
- "8.4"
316+
- "8.5"
313317
dbal-version:
314318
- "default"
315319
- "3.7"

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
documentation:
1919
name: "Documentation"
20-
uses: "doctrine/.github/.github/workflows/documentation.yml@8.0.0"
20+
uses: "doctrine/.github/.github/workflows/documentation.yml@10.1.0"

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
release:
10-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@8.0.0"
10+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@10.1.0"
1111
secrets:
1212
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1313
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

docs/en/reference/limitations-and-known-issues.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ internally by the ORM currently refers to fields by their name only, without tak
178178
class containing the field into consideration. This makes it impossible to keep separate
179179
mapping configuration for both fields.
180180

181+
Apart from that, in the case of having multiple ``private`` fields of the same name within
182+
the class hierarchy an entity or mapped superclass, the Collection filtering API cannot determine
183+
the right field to look at. Even if only one of these fields is actually mapped, the ``ArrayCollection``
184+
will not be able to tell, since it does not have access to any metadata.
185+
186+
Thus, to avoid problems in this regard, it is best to avoid having multiple ``private`` fields of the
187+
same name in class hierarchies containing entity and mapped superclasses.
188+
181189
Known Issues
182190
------------
183191

src/Mapping/Driver/ReflectionBasedDriver.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ trait ReflectionBasedDriver
2222
*/
2323
private function isRepeatedPropertyDeclaration(ReflectionProperty $property, ClassMetadata $metadata): bool
2424
{
25-
/** @var class-string $declaringClass */
2625
$declaringClass = $property->class;
2726

28-
if ($this->isTransient($declaringClass)) {
29-
return isset($metadata->fieldMappings[$property->name]);
30-
}
31-
3227
if (
3328
isset($metadata->fieldMappings[$property->name]->declared)
3429
&& $metadata->fieldMappings[$property->name]->declared === $declaringClass

tests/Tests/Models/Enums/Library.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
use Doctrine\ORM\Mapping\GeneratedValue;
1212
use Doctrine\ORM\Mapping\Id;
1313
use Doctrine\ORM\Mapping\OneToMany;
14+
use Doctrine\ORM\Mapping\Table;
1415

1516
#[Entity]
17+
#[Table('`library`')]
1618
class Library
1719
{
1820
#[Id]

tests/Tests/ORM/Functional/Ticket/GH10450Test.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ public static function classesThatOverrideFieldNames(): Generator
3030
yield 'Entity class that redeclares a protected field inherited from a base entity' => [GH10450EntityChildProtected::class];
3131
yield 'Entity class that redeclares a protected field inherited from a mapped superclass' => [GH10450MappedSuperclassChildProtected::class];
3232
}
33-
34-
public function testFieldsOfTransientClassesAreNotConsideredDuplicate(): void
35-
{
36-
$em = $this->getTestEntityManager();
37-
38-
$metadata = $em->getClassMetadata(GH10450Cat::class);
39-
40-
self::assertArrayHasKey('id', $metadata->fieldMappings);
41-
}
4233
}
4334

4435
#[ORM\Entity]
@@ -122,26 +113,3 @@ class GH10450MappedSuperclassChildProtected extends GH10450BaseMappedSuperclassP
122113
#[ORM\Column(type: 'text', name: 'child')]
123114
protected string $field;
124115
}
125-
126-
abstract class GH10450AbstractEntity
127-
{
128-
#[ORM\Column(type: 'integer')]
129-
#[ORM\Id]
130-
#[ORM\GeneratedValue]
131-
protected int $id;
132-
}
133-
134-
#[ORM\Entity]
135-
#[ORM\InheritanceType('SINGLE_TABLE')]
136-
#[ORM\DiscriminatorMap(['cat' => GH10450Cat::class])]
137-
#[ORM\DiscriminatorColumn(name: 'type')]
138-
abstract class GH10450Animal extends GH10450AbstractEntity
139-
{
140-
#[ORM\Column(type: 'text', name: 'base')]
141-
private string $field;
142-
}
143-
144-
#[ORM\Entity]
145-
class GH10450Cat extends GH10450Animal
146-
{
147-
}

0 commit comments

Comments
 (0)