You are here

public function Context::hasContextValue in Drupal 8

Same name in this branch
  1. 8 core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::hasContextValue()
  2. 8 core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::hasContextValue()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::hasContextValue()

Returns whether the context has a value.

Return value

bool TRUE if the context has a value, FALSE otherwise.

Overrides ContextInterface::hasContextValue

1 call to Context::hasContextValue()
Context::hasContextValue in core/lib/Drupal/Core/Plugin/Context/Context.php
Returns whether the context has a value.
1 method overrides Context::hasContextValue()
Context::hasContextValue in core/lib/Drupal/Core/Plugin/Context/Context.php
Returns whether the context has a value.

File

core/lib/Drupal/Component/Plugin/Context/Context.php, line 64

Class

Context
A generic context class for wrapping data a plugin needs to operate.

Namespace

Drupal\Component\Plugin\Context

Code

public function hasContextValue() {
  return (bool) $this->contextValue || (bool) $this
    ->getContextDefinition()
    ->getDefaultValue();
}