original_string: 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,
          );
      }
code: 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,
          );
      }
code_tokens: 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 , ) ; }
docstring: Return blog entries.
  
  @param array $filters the parameters to filter the blog listing
  @param int $page the blog page to return
  @param int $perpage the number of posts to return per page
  @return array with the blog entries and warnings
  @since  Moodle 3.6
docstring_tokens: Return blog entries .