. /** * Contains the contextlist persistent. * * @package tool_dataprivacy * @copyright 2018 Jake Dallimore * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_dataprivacy; defined('MOODLE_INTERNAL') || die(); use core\persistent; /** * The contextlist persistent. * * @copyright 2018 Jake Dallimore * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class contextlist extends persistent { /** The table name this persistent object maps to. */ const TABLE = 'tool_dataprivacy_contextlist'; /** * Return the definition of the properties of this model. * * @return array */ protected static function define_properties() { return [ 'component' => [ 'type' => PARAM_TEXT ] ]; } /** * Create a new contextlist persistent from an instance of \core_privacy\local\request\contextlist. * * @param \core_privacy\local\request\contextlist $contextlist the core privacy contextlist. * @return contextlist a contextlist persistent. */ public static function from_contextlist(\core_privacy\local\request\contextlist $contextlist) : contextlist { $contextlistpersistent = new contextlist(); return $contextlistpersistent->set('component', $contextlist->get_component()); } }