function ContextualLinkManager::getContextualLinkPluginsByGroup
Overrides ContextualLinkManagerInterface::getContextualLinkPluginsByGroup
1 call to ContextualLinkManager::getContextualLinkPluginsByGroup()
- ContextualLinkManager::getContextualLinksArrayByGroup in core/
lib/ Drupal/ Core/ Menu/ ContextualLinkManager.php - Gets the contextual links prepared as expected by links.html.twig.
File
-
core/
lib/ Drupal/ Core/ Menu/ ContextualLinkManager.php, line 150
Class
- ContextualLinkManager
- Defines a contextual link plugin manager to deal with contextual links.
Namespace
Drupal\Core\MenuCode
public function getContextualLinkPluginsByGroup($group_name) {
if (isset($this->pluginsByGroup[$group_name])) {
$contextual_links = $this->pluginsByGroup[$group_name];
}
elseif ($cache = $this->cacheBackend
->get($this->cacheKey . ':' . $group_name)) {
$contextual_links = $cache->data;
$this->pluginsByGroup[$group_name] = $contextual_links;
}
else {
$contextual_links = [];
foreach ($this->getDefinitions() as $plugin_id => $plugin_definition) {
if ($plugin_definition['group'] == $group_name) {
$contextual_links[$plugin_id] = $plugin_definition;
}
}
$this->cacheBackend
->set($this->cacheKey . ':' . $group_name, $contextual_links);
$this->pluginsByGroup[$group_name] = $contextual_links;
}
return $contextual_links;
}