In doctrine, is it possible to add a WHERE clause when fetching a property of an object that corresponds to a relationship?
In terms of concept, let's say I want to retrieve only the first 3 blog posts made in the last 5 days. My "blog" object has a "posts" property which is defined as a relationship.
Update...
As some people are having some difficulties understanding what I mean by a relationship:
class Blog extends Doctrine_Record {
...
public function setUp() {
$this->hasMany("Note as Posts", array(
"local" => "blog_name",
"foreign" => "post_id",
"refClass" => "BlogPost"
));
}
}
As you can see, this is an explicit relationship as supported by doctrine. When I query using it:
$instanceOfBlog->Posts...........
I'd like to know if I can add additional clauses at that time.