You are here

function migrate_invoke_all in Migrate 6

Call a migrate hook. Like module_invoke_all, but gives modules a chance to do one-time initialization before any of their hooks are called, and adds "migrate" to the hook name.

Parameters

$hook: Hook to invoke (e.g., 'types', 'fields_node', etc.)

Return value

Merged array of results.

6 calls to migrate_invoke_all()
migrate_content_process_clear in ./migrate.module
Clear migrated objects from the specified content set
migrate_content_process_import in ./migrate.module
Import objects from the specified content set
migrate_content_set_mappings in ./migrate_pages.inc
Menu callback function for content set edit page.
migrate_update_6003 in ./migrate.install
Hook names have changed - notify the admin
migrate_xlat in ./migrate.module

... See full list

File

./migrate.module, line 41
This module provides tools at "administer >> content >> migrate" for analyzing data from various sources and importing them into Drupal tables.

Code

function migrate_invoke_all($hook) {

  // Let modules do any one-time initialization (e.g., including migration support files)
  global $_migrate_inited;
  if (!isset($_migrate_inited)) {
    module_invoke_all('migrate_init');
    $_migrate_inited = TRUE;
  }
  $args = func_get_args();
  $hookfunc = "migrate" . "_{$hook}";
  unset($args[0]);
  $return = array();
  $modulelist = module_implements($hookfunc);
  foreach ($modulelist as $module) {
    $function = $module . '_' . $hookfunc;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}