original_string: public function export_external_structure($page = 0, $perpage = 0) {
  
          $this->buildforexternal = true;
          $this->add_all_values_to_output();
          // Set-up.
          $this->setup();
          // Override values, if needed.
          if ($perpage > 0) {
              $this->pageable = true;
              $this->currpage = $page;
              $this->pagesize = $perpage;
          } else {
              $this->pagesize = $this->get_total_responses_count();
          }
          $this->query_db($this->pagesize, false);
          $this->build_table();
          $this->close_recordset();
          return $this->dataforexternal;
      }
code: public function export_external_structure($page = 0, $perpage = 0) {
  
          $this->buildforexternal = true;
          $this->add_all_values_to_output();
          // Set-up.
          $this->setup();
          // Override values, if needed.
          if ($perpage > 0) {
              $this->pageable = true;
              $this->currpage = $page;
              $this->pagesize = $perpage;
          } else {
              $this->pagesize = $this->get_total_responses_count();
          }
          $this->query_db($this->pagesize, false);
          $this->build_table();
          $this->close_recordset();
          return $this->dataforexternal;
      }
code_tokens: public function export_external_structure ( $ page = 0 , $ perpage = 0 ) { $ this -> buildforexternal = true ; $ this -> add_all_values_to_output ( ) ; // Set-up. $ this -> setup ( ) ; // Override values, if needed. if ( $ perpage > 0 ) { $ this -> pageable = true ; $ this -> currpage = $ page ; $ this -> pagesize = $ perpage ; } else { $ this -> pagesize = $ this -> get_total_responses_count ( ) ; } $ this -> query_db ( $ this -> pagesize , false ) ; $ this -> build_table ( ) ; $ this -> close_recordset ( ) ; return $ this -> dataforexternal ; }
docstring: Exports the table as an external structure handling pagination.
  
  @param int $page page number (for pagination)
  @param int $perpage elements per page
  @since Moodle 3.3
  @return array returns the table ready to be used by an external function
docstring_tokens: Exports the table as an external structure handling pagination .