Skip to content

Commit

Permalink
[GH-8471] Undeprecate all PARTIAL object usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Oct 9, 2024
1 parent 896c655 commit 93a7d2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
8 changes: 5 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ change in behavior.

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

## PARTIAL DQL syntax is undeprecated for non-object hydration
## PARTIAL DQL syntax is undeprecated

Use of the PARTIAL keyword is not deprecated anymore in DQL when used with a hydrator
that is not creating entities, such as the ArrayHydrator.
Use of the PARTIAL keyword is not deprecated anymore in DQL, because we will be
able to support PARTIAL objects with PHP 8.4 Lazy Objects and
Symfony/VarExporter in a better way. When we decided to remove this feature
these two abstractions did not exist yet.

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

Expand Down
8 changes: 0 additions & 8 deletions src/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1852,14 +1852,6 @@ public function JoinAssociationDeclaration()
*/
public function PartialObjectExpression()
{
if ($this->query->getHydrationMode() === Query::HYDRATE_OBJECT) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8471',
'PARTIAL syntax in DQL is deprecated for object hydration.'
);
}

$this->match(TokenType::T_PARTIAL);

$partialFieldSet = [];
Expand Down
9 changes: 0 additions & 9 deletions src/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2920,15 +2920,6 @@ private function newInstance(ClassMetadata $class)
*/
public function createEntity($className, array $data, &$hints = [])
{
if (isset($hints[SqlWalker::HINT_PARTIAL])) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8471',
'Partial Objects are deprecated for object hydration (here entity %s)',
$className
);
}

$class = $this->em->getClassMetadata($className);

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

0 comments on commit 93a7d2e

Please sign in to comment.