public function RelationsCiviCrmImportSettings::postImport in CRM Core 7
Performs when import was successful.
Overrides CRMCoreDataImportSettings::postImport
File
- modules/
crm_core_data_import/ plugins/ settings/ RelationsCiviCrmImportSettings.inc, line 164
Class
Code
public function postImport($importer, $item) {
$settings = $importer
->getSettings();
if (!empty($settings['relations']['enable']) && !empty($settings['relations']['relations_values']) && $item['entity_type'] == 'crm_core_contact' && is_a($importer->source_plugin, 'CivicrmDataSourceHandler')) {
$list = $importer->source_plugin
->getEntitiesForRelationships($settings['relations'], $item, $importer);
// Process list of the related entities.
foreach ($list as $item) {
$this
->createRelation($item['source_entity'], $item['destination_entity'], $item['plugin_data']['relation_type']);
}
}
}