You are here

public function NodeTooltip::setConfiguration in Glossify 8

Sets the configuration for this plugin instance.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Overrides FilterBase::setConfiguration

File

modules/glossify_node/src/Plugin/Filter/NodeTooltip.php, line 163

Class

NodeTooltip
Filter to find and process found taxonomy terms in the fields value.

Namespace

Drupal\glossify_node\Plugin\Filter

Code

public function setConfiguration(array $configuration) {
  if (isset($configuration['status'])) {
    $this->status = (bool) $configuration['status'];
  }
  if (isset($configuration['weight'])) {
    $this->weight = (int) $configuration['weight'];
  }
  if (isset($configuration['settings'])) {

    // Workaround for not accepting arrays in config schema.
    if (is_array($configuration['settings']['glossify_node_bundles'])) {
      $glossify_node_bundles = array_filter($configuration['settings']['glossify_node_bundles']);
      $configuration['settings']['glossify_node_bundles'] = implode(';', $glossify_node_bundles);
    }
    $this->settings = (array) $configuration['settings'];
  }
  return $this;
}