Drupal 8  8.0.2
ConditionInterface Interface Reference
Inheritance diagram for ConditionInterface:

Public Member Functions

 isNegated ()
 
 evaluate ()
 
 summary ()
 
 setExecutableManager (ExecutableManagerInterface $executableManager)
 
- Public Member Functions inherited from ExecutableInterface
 execute ()
 
- Public Member Functions inherited from PluginFormInterface
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
- Public Member Functions inherited from ConfigurablePluginInterface
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 defaultConfiguration ()
 
- Public Member Functions inherited from DependentPluginInterface
 calculateDependencies ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 

Detailed Description

An interface for condition plugins.

Condition plugins are context-aware and configurable. They support the following keys in their plugin definitions:

  • context: An array of context definitions, keyed by context name. Each context definition is a typed data definition describing the context. Check the typed data definition docs for details.
  • configuration: An array of configuration option definitions, keyed by option name. Each option definition is a typed data definition describing the configuration option. Check the typed data definition docs for details.
Todo:

Replace the dependency on with a new interface from https://www.drupal.org/node/2006248.

WARNING: The condition API is going to receive some additions before release. The following additions are likely to happen:

  • The way configuration is handled and configuration forms are built is likely to change in order for the plugin to be of use for Rules.
  • Conditions will receive a data processing API that allows for token replacements to happen outside of the plugin implementations, see https://www.drupal.org/node/2347023.
  • Conditions will have to implement access control for checking who is allowed to configure or perform the action at https://www.drupal.org/node/2172017.
See Also
::create()

Member Function Documentation

evaluate ( )

Evaluates the condition and returns TRUE or FALSE accordingly.

Returns
bool TRUE if the condition has been met, FALSE otherwise.

Implemented in RequestPath, Language, NodeType, CurrentThemeCondition, UserRole, OptionalContextCondition, ConditionTestDualUser, and BaloneySpam.

isNegated ( )

Determines whether condition result will be negated.

Returns
bool Whether the condition result will be negated.

Implemented in ConditionPluginBase.

setExecutableManager ( ExecutableManagerInterface  $executableManager)

Sets the executable manager class.

Parameters
\Drupal\Core\Executable\ExecutableManagerInterface$executableManagerThe executable manager.

Implemented in ConditionPluginBase.

summary ( )

Provides a human readable summary of the condition's configuration.

Implemented in RequestPath, CurrentThemeCondition, Language, NodeType, UserRole, OptionalContextCondition, ConditionTestDualUser, and BaloneySpam.


The documentation for this interface was generated from the following file: