Hi

Tables: Gig, Song and GigSong (many-to-many).

I use a pager and in executeIndex I set up the Query:

                $q = Doctrine_Query::create()
                ->from('Gig g')
                ->leftJoin('g.GigSong gs ON gs.gig_id = g.id')
                ->orderBy('gs.order_id ASC');

                $this->pager->setQuery($q);
                ...

On the indexSuccess page there will be a call $gig->getSongs() for
each gig.
class Gig ..
        public function getSongs()
        {
                $q = Doctrine_Query::create()
                ->from('Song s')
                ->leftJoin('s.GigSong gs ON s.id = gs.song_id')
                ->andWhere('gs.gig_id = ?', $this->id)
                ->orderBy('gs.order_id ASC');
                return $q->execute();
        }

This results in 25 queries. How can I join the songs in the first
query?

In advance
comb

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to