MDL-82158 core_cache: Move interfaces
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Cache store feature: configurable.
|
||||
*
|
||||
* This feature should be implemented by all cache stores that are configurable when adding an instance.
|
||||
* It requires the implementation of methods required to convert form data into the a configuration array for the
|
||||
* store instance, and then the reverse converting configuration data into an array that can be used to set the
|
||||
* data for the edit form.
|
||||
*
|
||||
* Can be implemented by classes already implementing cache_store.
|
||||
*/
|
||||
interface cache_is_configurable {
|
||||
|
||||
/**
|
||||
* Given the data from the add instance form this function creates a configuration array.
|
||||
*
|
||||
* @param stdClass $data
|
||||
* @return array
|
||||
*/
|
||||
public static function config_get_configuration_array($data);
|
||||
|
||||
/**
|
||||
* Allows the cache store to set its data against the edit form before it is shown to the user.
|
||||
*
|
||||
* @param moodleform $editform
|
||||
* @param array $config
|
||||
*/
|
||||
public static function config_set_edit_form_data(moodleform $editform, array $config);
|
||||
}
|
||||
Reference in New Issue
Block a user