You are here

public function DomainNavBlock::getSetting in Domain Access 8

Gets the configuration for the block, loading defaults if not set.

Parameters

string $key: The setting key to retrieve, a string.

Return value

string The setting value, a string.

2 calls to DomainNavBlock::getSetting()
DomainNavBlock::build in domain/src/Plugin/Block/DomainNavBlock.php
Build the output.
DomainNavBlock::getCacheContexts in domain/src/Plugin/Block/DomainNavBlock.php
The cache contexts associated with this object.

File

domain/src/Plugin/Block/DomainNavBlock.php, line 202

Class

DomainNavBlock
Provides a block that links to all active domains.

Namespace

Drupal\domain\Plugin\Block

Code

public function getSetting($key) {
  if (isset($this->settings[$key])) {
    return $this->settings[$key];
  }
  $defaults = $this
    ->defaultConfiguration();
  if (isset($this->configuration[$key])) {
    $this->settings[$key] = $this->configuration[$key];
  }
  else {
    $this->settings[$key] = $defaults[$key];
  }
  return $this->settings[$key];
}