public static function get_entries($filters = array(), $page = 0, $perpage = 10) {
        global $PAGE;

        $warnings = array();
        $params = self::validate_parameters(self::get_entries_parameters(),
            array('filters' => $filters, 'page' => $page, 'perpage' => $perpage));

        list($context, $filters, $courseid, $userid) = self::validate_access_and_filters($params['filters']);

        $PAGE->set_context($context); // Needed by internal APIs.
        $output = $PAGE->get_renderer('core');

        // Get filters.
        $blogheaders = blog_get_headers($filters['courseid'], $filters['groupid'], $filters['userid'], $filters['tagid'],
            $filters['tag'], $filters['cmid'], $filters['entryid'], $filters['search']);
        $bloglisting = new \blog_listing($blogheaders['filters']);

        $page  = $params['page'];
        $limit = empty($params['perpage']) ? get_user_preferences('blogpagesize', 10) : $params['perpage'];
        $start = $page * $limit;
        $entries = $bloglisting->get_entries($start, $limit);
        $totalentries = $bloglisting->count_entries();

        $exportedentries = array();
        foreach ($entries as $entry) {
            $exporter = new post_exporter($entry, array('context' => $context));
            $exportedentries[] = $exporter->export($output);
        }
        return array(
            'warnings' => $warnings,
            'entries' => $exportedentries,
            'totalentries' => $totalentries,
        );
    }