MDL-39477 repository: Introducing data generators for repositories
This commit is contained in:
committed by
Damyon Wiese
parent
d3aeeb93c2
commit
e5c6694de8
@@ -555,6 +555,37 @@ EOD;
|
||||
return groups_assign_grouping($record['groupingid'], $record['groupid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of a repository.
|
||||
*
|
||||
* @param string type of repository to create an instance for.
|
||||
* @param array|stdClass $record data to use to up set the instance.
|
||||
* @param array $options options
|
||||
* @return stdClass repository instance record
|
||||
* @since 2.6
|
||||
*/
|
||||
public function create_repository($type, $record=null, array $options = null) {
|
||||
global $CFG;
|
||||
$generator = $this->get_plugin_generator('repository_'.$type);
|
||||
return $generator->create_instance($record, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of a repository.
|
||||
*
|
||||
* @param string type of repository to create an instance for.
|
||||
* @param array|stdClass $record data to use to up set the instance.
|
||||
* @param array $options options
|
||||
* @return repository_type object
|
||||
* @since 2.6
|
||||
*/
|
||||
public function create_repository_type($type, $record=null, array $options = null) {
|
||||
global $CFG;
|
||||
$generator = $this->get_plugin_generator('repository_'.$type);
|
||||
return $generator->create_type($record, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a test scale
|
||||
* @param array|stdClass $record
|
||||
|
||||
Reference in New Issue
Block a user