Doctrine: Select elements that are related to one or more items in many-to-many relation

Posted by Migol on Stack Overflow See other posts from Stack Overflow or by Migol
Published on 2010-03-17T16:22:16Z Indexed on 2010/03/17 16:51 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I have a category system that is related many-to-many with posts. How can I select a list of those categories that are related to one or more posts?

$q = Doctrine_Query::create()
     ->from('Category c')
     ->where('<DONT KNOW WHAT TO WRITE>')
     ->select('c.name');

© Stack Overflow or respective owner

Related posts about doctrine

Related posts about php