function ContextAwarePluginBase::getContexts

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php \Drupal\Component\Plugin\ContextAwarePluginBase::getContexts()

Overrides ContextAwarePluginInterface::getContexts

6 calls to ContextAwarePluginBase::getContexts()
ContextAwarePluginBase::getCacheContexts in core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
The cache contexts associated with this object.
ContextAwarePluginBase::getCacheMaxAge in core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
The maximum age for which this object may be cached.
ContextAwarePluginBase::getCacheTags in core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
The cache tags associated with this object.
ContextAwarePluginBase::validateContexts in core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php
Validates the set values for the defined contexts.
SectionStorageBase::getContextsDuringPreview in core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php
Gets contexts for use during preview.

... See full list

File

core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php, line 124

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

public function getContexts() {
    // Make sure all context objects are initialized.
    foreach ($this->getContextDefinitions() as $name => $definition) {
        $this->getContext($name);
    }
    return $this->context;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.