Drupal 8  8.0.2
Language Class Reference
Inheritance diagram for Language:

Public Member Functions

 __construct (LanguageManagerInterface $language_manager, array $configuration, $plugin_id, $plugin_definition)
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
 summary ()
 
 evaluate ()
 
 defaultConfiguration ()
 
- Public Member Functions inherited from ConditionPluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 isNegated ()
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
 execute ()
 
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 defaultConfiguration ()
 
 calculateDependencies ()
 
 setExecutableManager (ExecutableManagerInterface $executableManager)
 
- Public Member Functions inherited from ExecutablePluginBase
 getConfigDefinitions ()
 
 getConfigDefinition ($key)
 
 getConfig ()
 
 setConfig ($key, $value)
 
- Public Member Functions inherited from ContextAwarePluginBase
 getContext ($name)
 
 setContext ($name, ComponentContextInterface $context)
 
 setContextValue ($name, $value)
 
 getContextMapping ()
 
 setContextMapping (array $context_mapping)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
- Public Member Functions inherited from ContextAwarePluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
 getContexts ()
 
 getContext ($name)
 
 setContext ($name, ContextInterface $context)
 
 getContextValues ()
 
 getContextValue ($name)
 
 setContextValue ($name, $value)
 
 validateContexts ()
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $languageManager
 
- Protected Attributes inherited from ConditionPluginBase
 $executableManager
 
- Protected Attributes inherited from ContextAwarePluginBase
 $context = []
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 
 contextHandler ()
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 

Detailed Description

Provides a 'Language' condition.

( id = "language", label = ("Language"), context = { "language" = ("language", label = ("Language")) } )

Constructor & Destructor Documentation

__construct ( LanguageManagerInterface  $language_manager,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)

Creates a new Language instance.

Parameters
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.
array$configurationThe plugin configuration, i.e. an array with configuration values keyed by configuration option name. The special key 'context' may be used to initialize the defined contexts by setting it to an array of context values keyed by context names.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.

References Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

{Form constructor.Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.
}

Implements PluginFormInterface.

References Drupal\languageManager(), and t().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

defaultConfiguration ( )

{Gets default configuration for this plugin.

Returns
array An associative array with the default configuration.
}

Implements ConfigurablePluginInterface.

evaluate ( )

{Evaluates the condition and returns TRUE or FALSE accordingly.

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

Implements ConditionInterface.

References ContextAwarePluginBase\getContextValue(), and ConditionPluginBase\isNegated().

Here is the call graph for this function:

submitConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.

References FormStateInterface\getValue().

Here is the call graph for this function:

summary ( )

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

Implements ConditionInterface.

References Drupal\languageManager(), LanguageInterface\STATE_ALL, and t().

Here is the call graph for this function:


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