abstract class OperatorBase in ThemeKey 8
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\themekey\Plugin\SingletonPluginBase implements ContainerFactoryPluginInterface
- class \Drupal\themekey\OperatorBase implements OperatorInterface
- class \Drupal\themekey\Plugin\SingletonPluginBase implements ContainerFactoryPluginInterface
Expanded class hierarchy of OperatorBase
2 files declare their use of OperatorBase
- Equals.php in src/
Plugin/ Operator/ Equals.php - Contains \Drupal\themekey\Plugin\Operator\Equals.
- Lower.php in src/
Plugin/ Operator/ Lower.php - Contains \Drupal\themekey\Plugin\Operator\Equals.
File
- src/
OperatorBase.php, line 14 - Provides Drupal\themekey\OperatorBase.
Namespace
Drupal\themekeyView source
abstract class OperatorBase extends SingletonPluginBase implements OperatorInterface {
public function getName() {
return $this->pluginDefinition['name'];
}
public function getDescription() {
return $this->pluginDefinition['description'];
}
/**
* {@inheritdoc}
*/
public function validate(PropertyAdminInterface $propertyAdmin, $value, FormStateInterface $form_state) {
if ($possibleValues = $propertyAdmin
->getPossibleValues()) {
if (!in_array($value, $possibleValues)) {
$form_state
->setErrorByName('value', $this
->t('Value needs to be one of %values', implode(', ', $possibleValues)));
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OperatorBase:: |
public | function |
Return the Description of the ThemeKey operator. Overrides OperatorInterface:: |
|
OperatorBase:: |
public | function |
Return the name of the ThemeKey operator. Overrides OperatorInterface:: |
|
OperatorBase:: |
public | function |
Validate. Overrides OperatorInterface:: |
|
OperatorInterface:: |
public | function | Return the Description of the ThemeKey operator. | 2 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
SingletonPluginBase:: |
protected static | property | ||
SingletonPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |