You are here

public function BreakpointManager::getGroupProviders in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::getGroupProviders()

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 212
Contains \Drupal\breakpoint\BreakpointManager.

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;
}