public function getPublishedPosts()
    {
        return PostSearch::find()
            ->joinWith('category')
            ->where(['publish_status' => Post::STATUS_PUBLISHED, 'blog_category.id' => $this->id])
            ->all();
    }
public function getPublishedPosts()
    {
        return PostSearch::find()
            ->joinWith('category')
            ->where(['publish_status' => Post::STATUS_PUBLISHED, 'blog_category.id' => $this->id])
            ->all();
    }
public function getPublishedPosts ( ) { return PostSearch :: find ( ) -> joinWith ( 'category' ) -> where ( [ 'publish_status' => Post :: STATUS_PUBLISHED , 'blog_category.id' => $ this -> id ] ) -> all ( ) ; }
Get published posts
@return array|\yii\db\ActiveRecord[]
Get published posts