You are here

function backup_migrate_crud_subtypes in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/crud.inc \backup_migrate_crud_subtypes()
  2. 7.3 includes/crud.inc \backup_migrate_crud_subtypes()

Get a list of avaiable classes of each crud type.

5 calls to backup_migrate_crud_subtypes()
backup_migrate_crud_menu in includes/crud.inc
Get the menu items handled by the CRUD code.
backup_migrate_crud_subtype_info in includes/crud.inc
Get the info for a particular crud subtype.
backup_migrate_get_destination_subtypes in includes/destinations.inc
Get the available destination types.
backup_migrate_get_location_subtypes in includes/locations.inc
Get the available location types.
backup_migrate_get_source_subtypes in includes/sources.inc
Get the available source types.

File

includes/crud.inc, line 51
CRUD functions for backup and migrate types (schedules, profiles etc.).

Code

function backup_migrate_crud_subtypes($type) {
  $out = array();
  if ($info = backup_migrate_crud_type_info($type)) {

    // Include the function that contains the type base.
    if (!empty($info['include'])) {
      backup_migrate_include($info['include']);
    }

    // Allow modules (including this one) to declare backup and migrate subtypes.
    // We don't use module_invoke_all so we can avoid the side-effects of array_merge_recursive.
    $out = array();
    foreach (module_implements('backup_migrate_' . $type . '_subtypes') as $module) {
      $function = $module . '_backup_migrate_' . $type . '_subtypes';
      $result = $function();
      if (isset($result) && is_array($result)) {
        foreach ($result as $key => $val) {
          $out[$key] = $val;
        }
      }
    }
  }
  return $out;
}