You are here

public function RngContactType::calculateDependencies in RNG Contact 8

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/RngContactType.php, line 92

Class

RngContactType
Defines the contact type configuration entity.

Namespace

Drupal\rng_contact\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();
  $email_field_id = $this
    ->getCourierEmailField();
  $email_field = FieldConfig::loadByName('rng_contact', $this
    ->id(), $email_field_id);
  if ($email_field) {
    $this
      ->addDependency('config', $email_field
      ->getConfigDependencyName());
  }
  return $this;
}