public function Language::evaluate

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

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

Overrides ConditionInterface::evaluate

File

drupal/core/modules/language/lib/Drupal/language/Plugin/Condition/Language.php, line 103
Contains \Drupal\language\Plugin\Condition\Language.

Class

Language
Provides a 'Language' condition.

Namespace

Drupal\language\Plugin\Condition

Code

public function evaluate() {
  $language = $this
    ->getContextValue('language');

  // Language visibility settings.
  if (!empty($this->configuration['langcodes'])) {
    return !empty($this->configuration['langcodes'][$language->langcode]);
  }
  return TRUE;
}