You are here

public function ContactBlock::calculateDependencies in Contact Block 8

Overrides BlockPluginTrait::calculateDependencies

File

src/Plugin/Block/ContactBlock.php, line 235

Class

ContactBlock
Provides a 'ContactBlock' block.

Namespace

Drupal\contact_block\Plugin\Block

Code

public function calculateDependencies() {
  $dependencies = array_merge_recursive(parent::calculateDependencies(), [
    'config' => [],
  ]);

  // Add the contact form as a dependency.
  if ($contact_form = $this
    ->getContactForm()) {
    $dependencies['config'][] = $contact_form
      ->getConfigDependencyName();
  }
  return $dependencies;
}