public function getPosts() { $posts = new Post('search'); $posts->unsetAttributes(); $posts->blog_id = $this->id; $posts->status = Post::STATUS_PUBLISHED; $posts->access_type = Post::ACCESS_PUBLIC; return $posts; }
/** * * @param int $limit [description] * @return array */ public static function get_posts($limit = false) { $blog = new Blog('posts/'); // Get drafted posts as well if (User::is_logged_in()) { return $blog->getAllPosts($limit); } return $blog->getPosts($limit); }