tags:

views:

75

answers:

0

Is it possible to have the Doctrine Collection INDEXBY feature used in RawSql? If so, how?

I'd like to index the collection returned by the following query on s.constant_name.

$q = new Doctrine_RawSql();
$q->select('{s.*}, {us.*}')
   ->from('User u 
           CROSS JOIN Setting s
           LEFT JOIN User_Setting us
           ON us.usr_auto_key = u.usr_auto_key 
           AND us.set_auto_key = s.set_auto_key')
   ->addComponent('us', 'User_Setting us')
   ->addComponent('u', 'us.User u')
   ->addComponent('s', 'us.Setting s')
   ->where('s.sct_auto_key = ? AND u.usr_auto_key = ?',array(SETTING_USER, $this->usr_auto_key));