#1379: Impossible to retrieve custom columns added to DQL SELECT
-----------------------------------+----------------------------------------
Reporter: francois | Owner: jwage
Type: defect | Status: new
Priority: minor | Milestone: Unknown
Component: Attributes | Version: 0.11
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
The Doctrine hydration process seems to fail to hydrate custom columns on
related objects when the relation is indirect.
Here is a DQL example:
{{{
//Article has many Comments
SELECT c.*, a.title ArticleTitle FROM Comment c INNER JOIN c.Article a
LIMIT 1
// will hydrate a Comment object looking like
-
id: 123
body: I completely agree
article_id: 456
Article:
id: ~
title: ~
body: ~
ArticleTitle: Hello, world
}}}
So that works, since I can retrieve my custom `ArticleTitle` column by
calling `$comment['Article']['ArticleTitle']`.
But when the relation is twofold, it fails:
{{{
//Article has many Comments
//Article has one Category
SELECT c.*, cat.name CategoryName FROM Comment c INNER JOIN c.Article a
INNER JOIN a.Category cat LIMIT 1
// will hydrate a Comment object looking like
-
id: 123
body: I completely agree
article_id: 456
}}}
I would expect to be able to retrieve the custom `CategoryName` column by
calling `$comment['Article']['Category']['CategoryName']`. But it fails,
the hydrated object doesn't even have an `Article` property.
I have checked the generated SQL code, and in both cases it is correct.
The problem probably lies in the hydration process.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1379>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---