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
-
core/
modules/ language/ src/ Plugin/ Condition/ Language.php, line 138
Class
- Language
- Provides a 'Language' condition.
Namespace
Drupal\language\Plugin\ConditionCode
public function evaluate() {
if (empty($this->configuration['langcodes']) && !$this->isNegated()) {
return TRUE;
}
$language = $this->getContextValue('language');
// Language visibility settings.
return !empty($this->configuration['langcodes'][$language->getId()]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.