public function RelatedProperties::getPluginDefinition in Salesforce Suite 8.4
Same name and namespace in other branches
- 5.0.x modules/salesforce_mapping/src/Plugin/SalesforceMappingField/RelatedProperties.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\RelatedProperties::getPluginDefinition()
Gets the definition of the plugin implementation.
Return value
array The plugin definition, as returned by the discovery object used by the plugin manager.
Overrides PluginBase::getPluginDefinition
1 call to RelatedProperties::getPluginDefinition()
- RelatedProperties::checkFieldMappingDependency in modules/
salesforce_mapping/ src/ Plugin/ SalesforceMappingField/ RelatedProperties.php - On dependency removal, determine if this plugin needs to be removed.
File
- modules/
salesforce_mapping/ src/ Plugin/ SalesforceMappingField/ RelatedProperties.php, line 101
Class
- RelatedProperties
- Adapter for entity Reference and fields.
Namespace
Drupal\salesforce_mapping\Plugin\SalesforceMappingFieldCode
public function getPluginDefinition() {
$definition = parent::getPluginDefinition();
$definition['config_dependencies']['config'] = [];
$field_name = $this
->config('drupal_field_value');
if (strpos($field_name, ':')) {
[
$field_name,
$dummy,
] = explode(':', $field_name, 2);
}
// Add reference field.
if ($field = FieldConfig::loadByName($this->mapping
->getDrupalEntityType(), $this->mapping
->getDrupalBundle(), $field_name)) {
$definition['config_dependencies']['config'][] = $field
->getConfigDependencyName();
// Add dependencies of referenced field.
foreach ($field
->getDependencies() as $type => $dependency) {
foreach ($dependency as $item) {
$definition['config_dependencies'][$type][] = $item;
}
}
}
return $definition;
}