#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
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
-------------------------+--------------------------------------------------
Comment (by romanb):
Hi,
First of all, aliasing properties in the select clause is not recommended
and not even officially supported, so this behavior may not stay. Aliases
should only be used for calculated/aggregated columns.
Secondly, are you using 0.11 as specified in the ticket? If you upgrade to
the 1.0 branch you will probably get an exception on the second query,
telling you whats wrong. You need to select at least the primary key of
the Article class because it is the intermediary between Comment and
Category. Without that information its impossible to hydrate properly.
So you might want to try this:
{{{
SELECT c.*, a.id, cat.name CategoryName FROM Comment c INNER JOIN
c.Article a INNER JOIN a.Category cat LIMIT 1
}}}
Please close this ticket if this issue does not persist.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1379#comment:1>
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
-~----------~----~----~----~------~----~------~--~---