Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-8471] undeprecate partials completly #11647

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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