You are here

public function PhoneNumberSettings::calculateDependencies in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Entity/PhoneNumberSettings.php \Drupal\sms\Entity\PhoneNumberSettings::calculateDependencies()
  2. 2.1.x src/Entity/PhoneNumberSettings.php \Drupal\sms\Entity\PhoneNumberSettings::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

src/Entity/PhoneNumberSettings.php, line 223

Class

PhoneNumberSettings
Defines storage for an SMS Gateway instance.

Namespace

Drupal\sms\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();
  foreach ($this->fields as $map => $field_name) {
    $field_config = FieldConfig::loadByName($this
      ->getPhoneNumberEntityTypeId(), $this
      ->getPhoneNumberBundle(), $field_name);
    if ($field_config) {
      $this
        ->addDependency('config', $field_config
        ->getConfigDependencyName());
    }
  }
  return $this->dependencies;
}