public function onBeforeWrite()
    {
        parent::onBeforeWrite();
        $parent = $this->Parent();
        if ($parent->exists() && !$parent instanceof Blog) {
            $first_blog = Blog::get()->first();
            if ($first_blog) {
                $this->ParentID = $first_blog->ID;
            }
        }
        $this->extend('onBeforeWrite');
    }