You are here

public function CRMCoreDataImport::getDestinations in CRM Core 7

Returns all available destinations for current import task.

1 call to CRMCoreDataImport::getDestinations()
CRMCoreDataImport::getDestinationsForEntity in modules/crm_core_data_import/includes/controllers/CRMCoreDataImport.inc
Returns destination based on entity_type and bundle.

File

modules/crm_core_data_import/includes/controllers/CRMCoreDataImport.inc, line 167
Handler for data imports in CRM Core

Class

CRMCoreDataImport
@file Handler for data imports in CRM Core

Code

public function getDestinations() {
  $mapping = $this
    ->getMappingSettings();
  $destinations = array();
  if (!empty($mapping)) {
    foreach ($mapping as $key => $mapping_item) {
      list($entity_controller_type, $entity_bundle_mapping, $bundle_delta) = explode(':', $key);
      $entity_type_mapping = crm_core_data_import_get_destination_entity_type($entity_controller_type);
      $entity_key = $entity_type_mapping . ':' . $entity_bundle_mapping . ':' . $bundle_delta;
      $destinations[$entity_key] = crm_core_data_import_load_plugin_instance('crm_core_data_import_destination', $entity_controller_type);
      $destinations[$entity_key]->controller = $entity_controller_type;
      $destinations[$entity_key]->bundle = $entity_bundle_mapping;
    }
  }
  return $destinations;
}