[PR #554] [MERGED] Fixed ObjectHydrator when namespace alias is given. #8367

Closed
opened 2026-01-22 15:59:34 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/554
Author: @beregond
Created: 1/24/2013
Status: Merged
Merged: 2/2/2013
Merged by: @guilhermeblanco

Base: masterHead: hydrator-fix


📝 Commits (5)

  • 23e0bb7 Fixed ObjectHydrator when namespace alias is given.
  • 1949ff8 [DDC-2256] Added test for hydrator.
  • d7f8222 [DDC-2256] Moved aliases translation to ResultSetMapping, fixed tests.
  • 9355945 [DDC-2256] Code refactorization.
  • 92ada24 [DDC-2256] Code improvements.

📊 Changes

4 files changed (+144 additions, -3 deletions)

View changed files

📝 lib/Doctrine/ORM/AbstractQuery.php (+1 -0)
📝 lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php (+3 -3)
📝 lib/Doctrine/ORM/Query/ResultSetMapping.php (+25 -0)
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php (+115 -0)

📄 Description

Fixes problem when executing native query:

$rsm = new ResultSetMapping();

$rsm->addEntityResult('DbBundle:Player', 'p');
$rsm->addFieldResult('p', 'id', 'id');
$rsm->addFieldResult('p', 'name', 'name');

$rsm->addJoinedEntityResult('DbBundle:User', 'u', 'p', 'user');
$rsm->addFieldResult('u', 'user_id', 'id');

$em->createNativeQuery('...', $rsm);

Hydrator couldn't find cached metadata, when "joined entity result" class name wasn't fully qualified name (as in the example above).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/554 **Author:** [@beregond](https://github.com/beregond) **Created:** 1/24/2013 **Status:** ✅ Merged **Merged:** 2/2/2013 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `hydrator-fix` --- ### 📝 Commits (5) - [`23e0bb7`](https://github.com/doctrine/orm/commit/23e0bb73458e50abe668ee55b49a787ad1ca0ae1) Fixed ObjectHydrator when namespace alias is given. - [`1949ff8`](https://github.com/doctrine/orm/commit/1949ff86023657e3146982ce32c75a09a30a1710) [DDC-2256] Added test for hydrator. - [`d7f8222`](https://github.com/doctrine/orm/commit/d7f82221d163a86e079bdd1c183d042c9096daa9) [DDC-2256] Moved aliases translation to ResultSetMapping, fixed tests. - [`9355945`](https://github.com/doctrine/orm/commit/935594578a4c06b4593fb553b63e5199288639e7) [DDC-2256] Code refactorization. - [`92ada24`](https://github.com/doctrine/orm/commit/92ada246b506ada38d2dc4be26b86d25c0bf15e3) [DDC-2256] Code improvements. ### 📊 Changes **4 files changed** (+144 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/AbstractQuery.php` (+1 -0) 📝 `lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php` (+3 -3) 📝 `lib/Doctrine/ORM/Query/ResultSetMapping.php` (+25 -0) ➕ `tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php` (+115 -0) </details> ### 📄 Description Fixes problem when executing native query: ``` php $rsm = new ResultSetMapping(); $rsm->addEntityResult('DbBundle:Player', 'p'); $rsm->addFieldResult('p', 'id', 'id'); $rsm->addFieldResult('p', 'name', 'name'); $rsm->addJoinedEntityResult('DbBundle:User', 'u', 'p', 'user'); $rsm->addFieldResult('u', 'user_id', 'id'); $em->createNativeQuery('...', $rsm); ``` Hydrator couldn't find cached metadata, when "joined entity result" class name wasn't fully qualified name (as in the example above). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:59:34 +01:00
admin closed this issue 2026-01-22 15:59:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#8367