function backup_migrate_crud_type_load in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 includes/crud.inc \backup_migrate_crud_type_load()
- 8.3 includes/crud.inc \backup_migrate_crud_type_load()
- 6.3 includes/crud.inc \backup_migrate_crud_type_load()
- 6.2 includes/crud.inc \backup_migrate_crud_type_load()
- 7.2 includes/crud.inc \backup_migrate_crud_type_load()
Get a generic object of the given type to be used for static-like functions.
I'm not using actual static method calls since they don't work on variables prior to PHP 5.3.0.
11 calls to backup_migrate_crud_type_load()
- backup_migrate_crud_create in includes/
crud.inc - Page callback to create a new item.
- backup_migrate_crud_create_from_import in includes/
crud.inc - Create an object from the exported object.
- backup_migrate_crud_create_item in includes/
crud.inc - Create a new item of the given type.
- backup_migrate_crud_get_item in includes/
crud.inc - Get an item of the specified type.
- backup_migrate_crud_get_items in includes/
crud.inc - Get all items of the given type.
File
- includes/
crud.inc, line 94 - CRUD functions for backup and migrate types (schedules, profiles etc.).
Code
function backup_migrate_crud_type_load($type, $subtype = NULL) {
$out = $info = NULL;
if ($subtype) {
$info = backup_migrate_crud_subtype_info($type, $subtype);
}
else {
$info = backup_migrate_crud_type_info($type);
}
if (!empty($info)) {
if (!empty($info['include'])) {
require_once dirname(__FILE__) . '/' . $info['include'] . '.inc';
}
if (!empty($info['file'])) {
require_once './' . (isset($info['path']) ? $info['path'] : '') . $info['file'];
}
if (class_exists($info['class'])) {
$out = new $info['class']();
$out = $out
->create(array(
'subtype' => $subtype,
));
}
}
return $out;
}