mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
Remove redundant code
This commit is contained in:
parent
1ba72c74ce
commit
3fa3093d96
@ -490,32 +490,6 @@ class BlogPost extends Page
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* Sets blog relationship on all categories and tags assigned to this post.
|
||||
*/
|
||||
public function onAfterWrite()
|
||||
{
|
||||
parent::onAfterWrite();
|
||||
|
||||
foreach ($this->Categories() as $category) {
|
||||
/**
|
||||
* @var BlogCategory $category
|
||||
*/
|
||||
$category->BlogID = $this->ParentID;
|
||||
$category->write();
|
||||
}
|
||||
|
||||
foreach ($this->Tags() as $tag) {
|
||||
/**
|
||||
* @var BlogTag $tag
|
||||
*/
|
||||
$tag->BlogID = $this->ParentID;
|
||||
$tag->write();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user