Hi,

I have the same problem in few hours ago, this is my solution example, hope
it can help you.

        $q = Doctrine_Query::create()
                        ->from('Tagging tg, tg.Tag t')
                        ->select('tg.taggable_id')
                        ->whereIn("tg.taggable_id", array(1,2,3)
                        ->addWhere("tg.taggable_model = ?", 'news)
                        ->groupBy('tg.tag_id');

2010/10/2 Svetoslav Shterev <[email protected]>

> On Fri, 2010-10-01 at 07:12 -0700, Vikos wrote:
> > Hello
> >
> > The question: Can I do join without relation [with doctrine]?
>
> This question is probably better suited for the doctrine user group. You
> cannot make a join without a relation in doctrine.
> > My project schema is huge. Every record has 'created_by' filed... but
> > no foreign key. ( 60+ FK to one table can cause lot problems).
> >
> > A want to get a table joined with the creators. But doctrine don't
> > want to do it because it doesn't know any relation....
>
> You can disable exporting certain parts of the model when building sql
> for it. I don't remember the exact syntax for that though, but you might
> be able to make the build-sql task not create foreign keys for your
> table.
> > Is it possible to do a simple JOIN QUERY with DQL?
> > Or on the other side ...How can'I do it without manual hydration?
>
> You can use the RawSql class instead, I suppose.
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
祝 日安,


歐力資訊
簡名駿 / Cipher Chien
電話:(02)2990 9868

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to