You are here

public function Context::hasContextValue in Service Container 7.2

Same name and namespace in other branches
  1. 7 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

File

lib/Drupal/Component/Plugin/Context/Context.php, line 69
Contains \Drupal\Component\Plugin\Context\Context.

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();
}