mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Allow extensions of getBlogPosts for additional decorator filtering
This commit is contained in:
parent
fbb372d1b9
commit
008947959d
@ -105,7 +105,10 @@ class Blog extends Page {
|
||||
* @return DataList of BlogPost objects
|
||||
**/
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user