mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1818: ResultSetMapping::addJoinedEntityResult does not work #2291
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?
Originally created by @doctrinebot on GitHub (May 10, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user nikola.petkanski:
I'm trying to fetch the data for oneToMany relation, but it failed:
{quote}
Notice: Undefined index: SomeCompany\SomeBundle\Entity\SomeJoinedEntity in ..../symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 382
{quote}
While trying to debug the issue I came to the conclusion that if I use the FQDN entity name it works, but if using SomeBundle:SomeJoinedEntity does not. I also checked the unit tests and I wasn't able to find which test this behavior - they all use the FQDN and not the short name of the entity.
I wasn't sure whether this should be a Symfony 2.0.13 issue or a Doctrine2 one, but in the end I've the intention that it has to be posted here.
@doctrinebot commented on GitHub (May 11, 2012):
Comment created by @beberlei:
Its probably a usage problem. ResultSetMapping are used internally in Doctrine as well and they work there. Check Doctrine\ORM\Query\SQLWalker .php on how to use addJoinedentityResult with one-to-many associations. you probably have to set meta columns aswell.
@doctrinebot commented on GitHub (Jul 17, 2012):
Comment created by dante77:
I support Nikolas opinion that is a bug. With a simple 1:N (one to many) relation, using FQDNs for the entities involved works, where as the shorthand form SomeBundle:Entity does not (for the same, unaltered native query).
IMHO, the hydrating behaviour should be the same for FQDNs and shorthand entity names, but it is obviously not.
@doctrinebot commented on GitHub (Jul 17, 2012):
Comment created by @beberlei:
Just reading that part now, yes the shorthand does not work here, and can never work.
@doctrinebot commented on GitHub (Jul 17, 2012):
Comment created by nikola.petkanski:
Is it going to be fixed?
@doctrinebot commented on GitHub (Jul 17, 2012):
Comment created by @beberlei:
no, its not easy to fix it in ResultSetMapping without opening a can of worms.
@doctrinebot commented on GitHub (Jul 17, 2012):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Jul 17, 2012):
Comment created by nikola.petkanski:
Shouldn't this issue be marked as known instead of closed? It has to be fixed at some point, perhaps at the next major refactoring :)