Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContextHandler.php

function ContextHandler::getMatchingContexts

Overrides ContextHandlerInterface::getMatchingContexts

1 call to ContextHandler::getMatchingContexts()
ContextHandler::checkRequirements in core/lib/Drupal/Core/Plugin/Context/ContextHandler.php
Checks a set of requirements against a set of contexts.

File

core/lib/Drupal/Core/Plugin/Context/ContextHandler.php, line 74

Class

ContextHandler
Provides methods to handle sets of contexts.

Namespace

Drupal\Core\Plugin\Context

Code

public function getMatchingContexts(array $contexts, ContextDefinitionInterface $definition) {
    return array_filter($contexts, function (ContextInterface $context) use ($definition) {
        return $definition->isSatisfiedBy($context);
    });
}
RSS feed
Powered by Drupal