[PR #385] [CLOSED] set metadata for interface to be able to fetch entites by interface name #8114

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

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/385
Author: @Burgov
Created: 6/29/2012
Status: Closed

Base: masterHead: set_metadata_for_resolved_interface


📝 Commits (5)

  • 9c7f3f2 set metadata for interface to be able to fetch entites by interface name
  • dcf1655 added failing test
  • 8a111be Added new event to allow actions to be done before trying to load class metadata
  • 04381f7 Rebased and renamed PreLoadClassMetadata to OnClassMetadataNotFound
  • 61f5a27 added use statement

📊 Changes

4 files changed (+115 additions, -6 deletions)

View changed files

lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php (+75 -0)
📝 lib/Doctrine/ORM/Events.php (+7 -0)
📝 lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php (+24 -1)
📝 tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php (+9 -5)

📄 Description

using the new ResolveTargetEntity functionality we noticed we needed another feature:

From the Symfony Bundle defining the interface, we'd like to be able to fetch entities by this very interface name, e.g.:

$em->find('Foo\BarBundle\Entity\PersonInterface', 1);

or

$em->getRepository('Foo\BarBundle\Entity\PersonInterface')->findAll();

This PR sets metadata for the interface when metadata for a class is loaded that the interface is configured for


🔄 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/385 **Author:** [@Burgov](https://github.com/Burgov) **Created:** 6/29/2012 **Status:** ❌ Closed **Base:** `master` ← **Head:** `set_metadata_for_resolved_interface` --- ### 📝 Commits (5) - [`9c7f3f2`](https://github.com/doctrine/orm/commit/9c7f3f27471b204a23a937578496388747ffb5d8) set metadata for interface to be able to fetch entites by interface name - [`dcf1655`](https://github.com/doctrine/orm/commit/dcf16550de4c68c85e79363f4e2442ddf9ff4a69) added failing test - [`8a111be`](https://github.com/doctrine/orm/commit/8a111be4f918a6e5776bfaee8c272ad6cc008950) Added new event to allow actions to be done before trying to load class metadata - [`04381f7`](https://github.com/doctrine/orm/commit/04381f795f812ef1117ac6fbbee1f0238894cb97) Rebased and renamed PreLoadClassMetadata to OnClassMetadataNotFound - [`61f5a27`](https://github.com/doctrine/orm/commit/61f5a278ab950517e7af003c99537713c9d2f691) added use statement ### 📊 Changes **4 files changed** (+115 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php` (+75 -0) 📝 `lib/Doctrine/ORM/Events.php` (+7 -0) 📝 `lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php` (+24 -1) 📝 `tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php` (+9 -5) </details> ### 📄 Description using the new ResolveTargetEntity functionality we noticed we needed another feature: From the Symfony Bundle defining the interface, we'd like to be able to fetch entities by this very interface name, e.g.: ``` php $em->find('Foo\BarBundle\Entity\PersonInterface', 1); ``` or ``` php $em->getRepository('Foo\BarBundle\Entity\PersonInterface')->findAll(); ``` This PR sets metadata for the interface when metadata for a class is loaded that the interface is configured for --- <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:58:27 +01:00
admin closed this issue 2026-01-22 15:58:28 +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#8114