DDC-1743: [GH-315] [WIP] Allowing proxies to be passed to ORM public API #2393

Closed
doctrinebot opened this Issue Mar 31, 2012 · 8 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: #315

Message:

Basically, following happens:

$proxy = some_unserialization();
$em->persist($proxy); // exception because the class name is not recognized

Fortunately, just some replacements of get_class($entity) with Doctrine\Common\Util\ClassUtils::getClass($entity) fix the issue.

I wanted to leave this as [WIP] because I need some feedback on the test cases. All three tests fail without the patch, while Build Status 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.

Another issue is probably performance, as there is some minor overhead introduced. What I'd like to know is if https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/ClassUtils.php#L56 could be reduced to a if ($object instanceof Proxy) { ... }.

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-315] was synchronize
#315

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-315] was closed:
doctrine/common#315

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment