You are here

public function ContextAwarePluginTrait::getContexts in Drupal 9

6 calls to ContextAwarePluginTrait::getContexts()
ContextAwarePluginTrait::getCacheContexts in core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php
ContextAwarePluginTrait::getCacheMaxAge in core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php
ContextAwarePluginTrait::getCacheTags in core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php
ContextAwarePluginTrait::validateContexts in core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php
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/Core/Plugin/ContextAwarePluginTrait.php, line 46

Class

ContextAwarePluginTrait
Provides a trait to add context-aware functionality to plugins.

Namespace

Drupal\Core\Plugin

Code

public function getContexts() {

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