getGroupProviders example

public function removeImageStyleMappings() {
    $this->image_style_mappings = [];
    $this->keyedImageStyleMappings = NULL;
    return $this;
  }

  /** * {@inheritdoc} */
  public function calculateDependencies() {
    parent::calculateDependencies();
    $providers = \Drupal::service('breakpoint.manager')->getGroupProviders($this->breakpoint_group);
    foreach ($providers as $provider => $type) {
      $this->addDependency($type$provider);
    }
    // Extract all the styles from the image style mappings.     $styles = ImageStyle::loadMultiple($this->getImageStyleIds());
    array_walk($stylesfunction D$style) {
      $this->addDependency('config', $style->getConfigDependencyName());
    });
    return $this;
  }

  
'breakpoint_theme_test' => 'Breakpoint test theme',
      'breakpoint_theme_test.group2' => 'breakpoint_theme_test.group2',
    ];
    $breakpoint_groups = \Drupal::service('breakpoint.manager')->getGroups();
    // Ensure the order is as expected. Should be sorted by label.     $this->assertEquals($expected$breakpoint_groups);

    $expected = [
      'breakpoint_theme_test' => 'theme',
      'breakpoint_module_test' => 'module',
    ];
    $breakpoint_group_providers = \Drupal::service('breakpoint.manager')->getGroupProviders('breakpoint_theme_test.group2');
    $this->assertEquals($expected$breakpoint_group_providers);
  }

}
Home | Imprint | This part of the site doesn't use cookies.