Added 'where' conditional (can be use together with asc,desc,limit) support for Many-to-many relationship in DooSqlMagic You can do pretty advanced query for M:M relationshio with DooPHP ORM which solve N+1 queries. For example, BlogPost has many Tag, Tag has many BlogPost: 
Added 'where' conditional (can be use together with asc,desc,limit) support for Many-to-many relationship in DooSqlMagic
You can do pretty advanced query for M:M relationshio with DooPHP ORM which solve N+1 queries. For example, BlogPost has many Tag, Tag has many BlogPost: 

You can do pagination on the post, show only published post, display posts that don't have any tags, sort by time and post id, tag name, etc.

$p = new Post();
$p->status = 1;
Doo::db()->relate($p,'Tag', array('asc'=>'post.createtime, post.id', 'desc'=>'post.title,tag.name','match'=>false, 'limit'=>'0,5'));

git-svn-id: cc6bf778016782145e08f50c22fd3532de014314@100 eaaf3d48-7251-11de-8585-3f51e31374b7

darkredz/DooPHP,darkredz/DooPHP