You are here

public function SalesforceMapping::calculateDependencies in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::calculateDependencies()
  2. 5.0.x modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

modules/salesforce_mapping/src/Entity/SalesforceMapping.php, line 319

Class

SalesforceMapping
Defines a Salesforce Mapping configuration entity class.

Namespace

Drupal\salesforce_mapping\Entity

Code

public function calculateDependencies() {

  // Include config dependencies on all mapped Drupal fields.
  foreach ($this
    ->getFieldMappings() as $field) {
    foreach ($field
      ->getDependencies($this) as $type => $deps) {
      foreach ($deps as $dep) {
        $this
          ->addDependency($type, $dep);
      }
    }
  }
  if ($this
    ->doesPull()) {
    $this
      ->addDependency('module', 'salesforce_pull');
  }
  if ($this
    ->doesPush()) {
    $this
      ->addDependency('module', 'salesforce_push');
  }
  return $this;
}