You are here

protected function ChainConditionBase::createPluginInstance in Access Filter 8

Creates plugin instance.

Parameters

array $condition: The array containing condition data.

Return value

\Drupal\access_filter\Plugin\ConditionInterface|bool Plugin instance or FALSE if failed.

4 calls to ChainConditionBase::createPluginInstance()
AndCondition::isMatched in src/Plugin/AccessFilter/Condition/AndCondition.php
Checks the current access is matched to the condition.
ChainConditionBase::summary in src/Plugin/AccessFilter/Condition/ChainConditionBase.php
Gets summary text for the condition.
ChainConditionBase::validateConfiguration in src/Plugin/AccessFilter/Condition/ChainConditionBase.php
Validates configuration data.
OrCondition::isMatched in src/Plugin/AccessFilter/Condition/OrCondition.php
Checks the current access is matched to the condition.

File

src/Plugin/AccessFilter/Condition/ChainConditionBase.php, line 93

Class

ChainConditionBase
Base class for condition plugins that chains other conditions.

Namespace

Drupal\access_filter\Plugin\AccessFilter\Condition

Code

protected function createPluginInstance(array $condition) {
  $plugins = $this->conditionPluginManager
    ->getDefinitions();
  $plugin_id = $condition['type'];
  if (isset($plugins[$plugin_id])) {
    return $this->conditionPluginManager
      ->createInstance($plugin_id, $condition);
  }
  return FALSE;
}