Merge pull request #3 from clyonsEIS/master

Allow extensions of getBlogPosts for additional decorator filtering
This commit is contained in:
Michael Strong 2013-10-09 08:58:50 -07:00
commit 0c30e8f4b6

View File

@ -105,7 +105,10 @@ class Blog extends Page {
* @return DataList of BlogPost objects * @return DataList of BlogPost objects
**/ **/
public function getBlogPosts() { public function getBlogPosts() {
return BlogPost::get()->filter("ParentID", $this->ID); $blogPosts = BlogPost::get()->filter("ParentID", $this->ID);
//Allow decorators to manipulate list
$this->extend('updateGetBlogPosts', $blogPosts);
return $blogPosts;
} }
} }