#1380: Lack of a clear way to access calculated DQL columns
-------------------------+--------------------------------------------------
  Reporter:  francois    |       Owner:  jwage                
      Type:  defect      |      Status:  new                  
  Priority:  minor       |   Milestone:  1.0.1                
 Component:  Attributes  |     Version:  1.0                  
Resolution:              |    Keywords:                       
  Has_test:  0           |    Mystatus:  Pending Core Response
 Has_patch:  0           |  
-------------------------+--------------------------------------------------
Comment (by jwage):

 After thinking about this, the behavior is consistent and correct. The
 calculate value is always hydrated in to the first component involved in
 the expression.

 {{{
 SELECT u.*, p.*, (COUNT(p.id) + COUNT(u.id)) AS test_calculated_column
 FROM User u, u.Phonenumber p
 }}}

 In the above example the test_calculated_column would be hydrated in to:

 {{{
 $users[0]['Phonenumber'][0]['test_calculated_column']
 }}}

 {{{
 SELECT u.*, p.*, (COUNT(u.id) + COUNT(p.id)) AS test_calculated_column
 FROM User u, u.Phonenumber p
 }}}

 This would be hydrated in to the root component since u.id it the first
 component encountered in the query:

 {{{
 $users[0]['test_calculated_column']
 }}}

 So, after seeing how it really works. It seems that nothing is wrong, we
 just need to document that calculated column values are always hydrated in
 to the first component involved in the expression.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1380#comment:5>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to