You are here

public function PropertiesBase::checkFieldMappingDependency in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesBase.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\PropertiesBase::checkFieldMappingDependency()

On dependency removal, determine if this plugin needs to be removed.

Parameters

array $dependencies: Dependencies, as provided to ConfigEntityInterface::onDependencyRemoval.

Return value

bool TRUE if the field should be removed, otherwise false.

Overrides SalesforceMappingFieldPluginBase::checkFieldMappingDependency

File

modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesBase.php, line 70

Class

PropertiesBase
Base class for properties plugins.

Namespace

Drupal\salesforce_mapping\Plugin\SalesforceMappingField

Code

public function checkFieldMappingDependency(array $dependencies) {
  $definition = $this
    ->getPluginDefinition();
  foreach ($definition['config_dependencies'] as $type => $dependency) {
    foreach ($dependency as $item) {
      if (!empty($dependencies[$type][$item])) {
        return TRUE;
      }
    }
  }

  // @TODO: Should we validate the $config['drupal_field_value']['setting'] property?
}