class ReferencesImportSettings in CRM Core 7
Hierarchy
- class \CRMCoreDataImportSettings
- class \ReferencesImportSettingsBase
- class \ReferencesImportSettings
- class \ReferencesImportSettingsBase
Expanded class hierarchy of ReferencesImportSettings
1 string reference to 'ReferencesImportSettings'
- ReferencesImportSettings.inc in modules/
crm_core_data_import/ plugins/ settings/ ReferencesImportSettings.inc
File
- modules/
crm_core_data_import/ plugins/ settings/ ReferencesImportSettings.inc, line 14
View source
class ReferencesImportSettings extends ReferencesImportSettingsBase {
/**
* Returns TRUE if conditions match for settings.
*/
public function displayConditions($importer) {
$active = FALSE;
$settings = $importer
->getSettings();
$entity_types = $this
->entityList($settings);
if (!is_a($importer->source_plugin, 'CivicrmDataSourceHandler')) {
foreach ($entity_types as $entity_type) {
$fields = field_info_instances($entity_type['entity_type'], $entity_type['bundle']);
foreach ($fields as $field_name => $field) {
$field_info = field_info_field($field_name);
if ($field_info['type'] == 'entityreference') {
$active = TRUE;
}
}
}
}
return $active;
}
/**
* Performs when import was successful.
*/
public function postImport($importer, $item) {
$settings = $importer
->getSettings();
if (!empty($settings['references']['enable']) && !empty($settings['references']['fields']) && !is_a($importer->source_plugin, 'CivicrmDataSourceHandler')) {
$list = $importer->source_plugin
->getEntitiesForReferences($settings['references'], $item, $importer);
foreach ($list as $item) {
$this
->createReference($item['source_entity'], $item['destination_entity'], $item['plugin_data']);
}
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CRMCoreDataImportSettings:: |
public | function | Clear form values. | |
CRMCoreDataImportSettings:: |
public | function | List of entities. | |
CRMCoreDataImportSettings:: |
public | function | Returns entity from mapping which match to entity type and bundle. | |
CRMCoreDataImportSettings:: |
public | function | Pre import handler. | 1 |
ReferencesImportSettings:: |
public | function |
Returns TRUE if conditions match for settings. Overrides CRMCoreDataImportSettings:: |
|
ReferencesImportSettings:: |
public | function |
Performs when import was successful. Overrides CRMCoreDataImportSettings:: |
|
ReferencesImportSettingsBase:: |
public | function |
Configuration form for settings plugin. Overrides CRMCoreDataImportSettings:: |
|
ReferencesImportSettingsBase:: |
public | function |
Submission handler for configForm(). Overrides CRMCoreDataImportSettings:: |
|
ReferencesImportSettingsBase:: |
public | function |
Validation handler for configForm(). Overrides CRMCoreDataImportSettings:: |
|
ReferencesImportSettingsBase:: |
public | function | Create reference between entities. | |
ReferencesImportSettingsBase:: |
public | function | Returns TRUE if entity bundle available in current settings. | |
ReferencesImportSettingsBase:: |
public | function | Returns TRUE if entity type available in current settings. | |
ReferencesImportSettingsBase:: |
public | function | Attach one reference field to form. | |
ReferencesImportSettingsBase:: |
public | function | Attach reference fields to form. | |
ReferencesImportSettingsBase:: |
public | function | Build a list of available references relevant to current settings. |