BreakpointManager::getGroupProviders

public BreakpointManager::getGroupProviders($group)

Gets all the providers for the specified breakpoint group.

Parameters

string $group: The breakpoint group to retrieve.

Return value

array An array keyed by provider name with values of provider type (module or theme).

Overrides BreakpointManagerInterface::getGroupProviders

File

core/modules/breakpoint/src/BreakpointManager.php, line 207

Class

BreakpointManager
Defines a breakpoint plugin manager to deal with breakpoints.

Namespace

Drupal\breakpoint

Code

public function getGroupProviders($group) {
  $providers = array();
  $breakpoints = $this->getBreakpointsByGroup($group);
  foreach ($breakpoints as $breakpoint) {
    $provider = $breakpoint->getProvider();
    $extension = FALSE;
    if ($this->moduleHandler->moduleExists($provider)) {
      $extension = $this->moduleHandler->getModule($provider);
    }
    elseif ($this->themeHandler->themeExists($provider)) {
      $extension = $this->themeHandler->getTheme($provider);
    }
    if ($extension) {
      $providers[$extension->getName()] = $extension->getType();
    }
  }
  return $providers;
}
doc_Drupal
2016-10-29 08:48:54
Comments
Leave a Comment

Please login to continue.