MDL-31989 mod_survey: Prevent templates from being indexed

This commit is contained in:
David Monllao 2016-02-23 19:58:48 +08:00
parent d71448e2a6
commit c625b01a4c

View File

@ -34,4 +34,19 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
/**
* Returns recordset containing required data for indexing activities.
*
* Overwritten to discard records with courseid = 0.
*
* @param int $modifiedfrom timestamp
* @return \moodle_recordset
*/
public function get_recordset_by_timestamp($modifiedfrom = 0) {
global $DB;
$select = 'course != ? AND ' . static::MODIFIED_FIELD_NAME . ' >= ?';
return $DB->get_recordset_select($this->get_module_name(), $select, array(0, $modifiedfrom));
}
}