The following :
$account = Account::model()->with(array('profile.comments'=> array('order' => 'coments.created', 'limit' => 5)))->find('`t`.name=:name', array(':name'=>$name));
should bring only five records from comments table, but it is fetching them all. any clue ?
I’m having exactly the same problem… I have reported an issue here
That’s not possible, as a LIMIT is not available for JOIN conditions in SQL. You can only use LIMIT on the complete result set.
Edit: Oh, Qiang already commented the same on your issue