MDL-36819 cache: implemented cache_is_configurable interface

This commit is contained in:
Sam Hemelryk
2012-11-26 14:27:44 +13:00
parent 75cde6b9ac
commit 2b274ad001
6 changed files with 36 additions and 9 deletions
+29
View File
@@ -338,6 +338,35 @@ interface cache_is_key_aware {
public function has_all(array $keys);
}
/**
* 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);
}
/**
* Cache Data Source.
*