function ContextHandler::checkRequirements
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextHandler.php \Drupal\Core\Plugin\Context\ContextHandler::checkRequirements()
- 10 core/lib/Drupal/Core/Plugin/Context/ContextHandler.php \Drupal\Core\Plugin\Context\ContextHandler::checkRequirements()
- 11.x core/lib/Drupal/Core/Plugin/Context/ContextHandler.php \Drupal\Core\Plugin\Context\ContextHandler::checkRequirements()
Overrides ContextHandlerInterface::checkRequirements
1 call to ContextHandler::checkRequirements()
- ContextHandler::filterPluginDefinitionsByContexts in core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextHandler.php - Determines plugins whose constraints are satisfied by a set of contexts.
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextHandler.php, line 62
Class
- ContextHandler
- Provides methods to handle sets of contexts.
Namespace
Drupal\Core\Plugin\ContextCode
public function checkRequirements(array $contexts, array $requirements) {
foreach ($requirements as $requirement) {
if ($requirement->isRequired() && !$this->getMatchingContexts($contexts, $requirement)) {
return FALSE;
}
}
return TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.