Merge branch 'MDL-54926-master' of git://github.com/merrill-oakland/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 11 Jul 2016 15:54:40 +0000 (16:54 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 11 Jul 2016 15:54:40 +0000 (16:54 +0100)
1  2 
search/classes/document.php
search/tests/fixtures/mock_search_area.php

Simple merge
@@@ -47,10 -41,23 +47,23 @@@ class mock_search_area extends \core_se
      public function get_recordset_by_timestamp($modifiedfrom = 0) {
          global $DB;
  
 -        // Filter by capability as we want this quick.
 -        return $DB->get_recordset_sql("SELECT * FROM {temp_mock_search_area} WHERE timemodified >= ?", array($modifiedfrom));
 +        $sql = "SELECT * FROM {temp_mock_search_area} WHERE timemodified >= ? ORDER BY timemodified ASC";
 +        return $DB->get_recordset_sql($sql, array($modifiedfrom));
      }
  
+     /**
+      * A helper function that will turn a record into 'data array', for use with document building.
+      */
+     public function convert_record_to_doc_array($record) {
+         $docdata = (array)unserialize($record->info);
+         $docdata['areaid'] = $this->get_area_id();
+         $docdata['itemid'] = $record->id;
+         $docdata['modified'] = $record->timemodified;
+         return $docdata;
+     }
      public function get_document($record, $options = array()) {
          global $USER;