Skip to content

Commit bea454e

Browse files
authored
[GH-8471] undeprecate partials completly (#11647)
* [GH-8471] Undeprecate all PARTIAL object usage.
1 parent 14f2572 commit bea454e

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

UPGRADE.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ change in behavior.
88

99
Progress on this is tracked at https://github.com/doctrine/orm/issues/11624 .
1010

11-
## PARTIAL DQL syntax is undeprecated for non-object hydration
11+
## PARTIAL DQL syntax is undeprecated
1212

13-
Use of the PARTIAL keyword is not deprecated anymore in DQL when used with a hydrator
14-
that is not creating entities, such as the ArrayHydrator.
13+
Use of the PARTIAL keyword is not deprecated anymore in DQL, because we will be
14+
able to support PARTIAL objects with PHP 8.4 Lazy Objects and
15+
Symfony/VarExporter in a better way. When we decided to remove this feature
16+
these two abstractions did not exist yet.
17+
18+
WARNING: If you want to upgrade to 3.x and still use PARTIAL keyword in DQL
19+
with array or object hydrators, then you have to directly migrate to ORM 3.3.x or higher.
20+
PARTIAL keyword in DQL is not available in 3.0, 3.1 and 3.2 of ORM.
1521

1622
## Deprecate `\Doctrine\ORM\Query\Parser::setCustomOutputTreeWalker()`
1723

src/Query/Parser.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,14 +1850,6 @@ public function JoinAssociationDeclaration()
18501850
*/
18511851
public function PartialObjectExpression()
18521852
{
1853-
if ($this->query->getHydrationMode() === Query::HYDRATE_OBJECT) {
1854-
Deprecation::trigger(
1855-
'doctrine/orm',
1856-
'https://github.com/doctrine/orm/issues/8471',
1857-
'PARTIAL syntax in DQL is deprecated for object hydration.'
1858-
);
1859-
}
1860-
18611853
$this->match(TokenType::T_PARTIAL);
18621854

18631855
$partialFieldSet = [];

src/UnitOfWork.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
use Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister;
4242
use Doctrine\ORM\Persisters\Entity\SingleTablePersister;
4343
use Doctrine\ORM\Proxy\InternalProxy;
44-
use Doctrine\ORM\Query\SqlWalker;
4544
use Doctrine\ORM\Utility\IdentifierFlattener;
4645
use Doctrine\Persistence\Mapping\RuntimeReflectionService;
4746
use Doctrine\Persistence\NotifyPropertyChanged;
@@ -2920,15 +2919,6 @@ private function newInstance(ClassMetadata $class)
29202919
*/
29212920
public function createEntity($className, array $data, &$hints = [])
29222921
{
2923-
if (isset($hints[SqlWalker::HINT_PARTIAL])) {
2924-
Deprecation::trigger(
2925-
'doctrine/orm',
2926-
'https://github.com/doctrine/orm/issues/8471',
2927-
'Partial Objects are deprecated for object hydration (here entity %s)',
2928-
$className
2929-
);
2930-
}
2931-
29322922
$class = $this->em->getClassMetadata($className);
29332923

29342924
$id = $this->identifierFlattener->flattenIdentifier($class, $data);

0 commit comments

Comments
 (0)