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}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue