Skip to content

Commit 4fd9e94

Browse files
authored
Merge pull request #12234 from mpdude/merge-3.5.x-into-3.6.x
Merge 3.5.x up into 3.6.x
2 parents 28d9472 + 1e33b77 commit 4fd9e94

File tree

10 files changed

+23
-44
lines changed

10 files changed

+23
-44
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"
@@ -189,6 +190,7 @@ jobs:
189190
- "8.2"
190191
- "8.3"
191192
- "8.4"
193+
- "8.5"
192194
dbal-version:
193195
- "default"
194196
- "3.7"
@@ -263,6 +265,7 @@ jobs:
263265
- "8.2"
264266
- "8.3"
265267
- "8.4"
268+
- "8.5"
266269
dbal-version:
267270
- "default"
268271
- "3.7"
@@ -330,6 +333,7 @@ jobs:
330333
- "8.2"
331334
- "8.3"
332335
- "8.4"
336+
- "8.5"
333337
dbal-version:
334338
- "default"
335339
- "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/Doctrine/Tests/ORM/Functional/Ticket/GH12063.php renamed to tests/Doctrine/Tests/ORM/Functional/Ticket/GH12063Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Doctrine\ORM\Mapping\Id;
1212
use Doctrine\Tests\OrmFunctionalTestCase;
1313

14-
class GH12063 extends OrmFunctionalTestCase
14+
class GH12063Test extends OrmFunctionalTestCase
1515
{
1616
protected function setUp(): void
1717
{
@@ -67,7 +67,7 @@ enum GH12063Code: string
6767
class GH12063Association
6868
{
6969
#[Id]
70-
#[Column]
70+
#[Column(length: 3)]
7171
public GH12063Code $code;
7272
}
7373

@@ -80,6 +80,6 @@ class GH12063Entity
8080
public int|null $id = null;
8181

8282
#[ORM\ManyToOne]
83-
#[ORM\JoinColumn(referencedColumnName: 'code')]
83+
#[ORM\JoinColumn(referencedColumnName: 'code', options: ['length' => 3])]
8484
public GH12063Association $association;
8585
}

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/QueryTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ public function testToIterableWithMixedResultEntityScalars(): void
432432
$this->_em->flush();
433433
$this->_em->clear();
434434

435-
$query = $this->_em->createQuery('select a, a.topic, a.text from ' . CmsArticle::class . ' a');
435+
$query = $this->_em->createQuery(
436+
'select a, a.topic, a.text from ' . CmsArticle::class . ' a order by a.id asc',
437+
);
436438
$result = $query->toIterable();
437439

438440
$it = iterator_to_array($result);

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)