Created
November 21, 2009 23:02
-
-
Save develop7/240326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//...snip | |
$q = Doctrine_Query::create()->from('Post p, p.Comments c')->select('p.*, c.*, COUNT(c.id) AS comment_count')->having('comment_count <= p.max_comments'); | |
$q->getSql(); //produces '... HAVING a2__0 <= p.max_comments ...' | |
//instead of '... HAVING a2__0 <= a__max_comments ...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Post: | |
columns: | |
content: string(1000) | |
max_comments: integer | |
relation: | |
Comments: | |
class: Comment | |
local: id | |
foreign: post_id | |
Comment: | |
columns: | |
post_id: integer | |
content: string(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment