You are here

public function WebformElements::checkFieldMappingDependency in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_webform/src/Plugin/SalesforceMappingField/WebformElements.php \Drupal\salesforce_webform\Plugin\SalesforceMappingField\WebformElements::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_webform/src/Plugin/SalesforceMappingField/WebformElements.php, line 112

Class

WebformElements
Adapter for Webform elements.

Namespace

Drupal\salesforce_webform\Plugin\SalesforceMappingField

Code

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