mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #315] [MERGED] Allowing proxies to be passed to ORM public API #8015
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/315
Author: @Ocramius
Created: 3/31/2012
Status: ✅ Merged
Merged: 5/4/2012
Merged by: @beberlei
Base:
master← Head:getclass-on-proxies-refactoring📝 Commits (6)
cbe4987Using Doctrine\Common\Util\ClassUtil for class_name resolutionThis avoids exceptions when passing a Proxy instance to the public API of the EntityManager, ClassMetadataFactory or UnitOfWork when the Proxy itself isn't generated by the EntityManager itself, while discovering the correct ClassMetadata instance for the proxyc4a2eaeAdding additional missing calls to classutils instead of get_class37279d0Adding test to verify validity of changes (fails without them)d1e868aRemoving registration of proxy ClassMetadata by the proxyFactory85ea27dAdding tests for additional usages of the proxy classname in ORM public APIcb7a77cRemoving usage of ClassUtil where not strictly needed📊 Changes
6 files changed (+178 additions, -45 deletions)
View changed files
📝
lib/Doctrine/ORM/AbstractQuery.php(+2 -2)📝
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(+32 -28)📝
lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(+3 -2)📝
lib/Doctrine/ORM/Proxy/ProxyFactory.php(+0 -4)📝
lib/Doctrine/ORM/UnitOfWork.php(+8 -9)➕
tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php(+133 -0)📄 Description
Basically, following happens:
This change forces loading of metadata even with proxy class names passed to the
ClassMetadataFactoryAPI.I need some feedback on the test cases. All three tests fail without the patch, while
with it applied.
What is a bit tricky is the status of the proxies.
Cases where
$__initialized__ = false;&&$_identifier = array();and others fail because of notices and weird issues that are very difficult to hunt down. That is because of the strange nature of proxies obviously. I just wanted to know if this should be somehow fixed in here.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.