Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Drupal\display_builder\Island;
6
7use Drupal\Component\Plugin\PluginManagerInterface;
8
9/**
10 * Island plugin manager interface.
11 */
12interface IslandPluginManagerInterface extends PluginManagerInterface {
13
14  /**
15   * Creates a pre-configured instance of a plugin.
16   *
17   * @param string $plugin_id
18   *   The ID of the plugin being instantiated.
19   * @param array $configuration
20   *   An array of configuration relevant to the plugin instance.
21   *
22   * @return \Drupal\display_builder\Island\IslandInterface
23   *   A fully configured island plugin instance.
24   */
25  public function createInstance($plugin_id, array $configuration = []);
26
27  /**
28   * Get islands plugins by type.
29   *
30   * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts
31   *   (Optional) An array of contexts, keyed by context name.
32   * @param array $configuration
33   *   (Optional) An array of configuration.
34   * @param array $filter_by_island
35   *   (Optional) Filter results by island ids.
36   *
37   * @return array
38   *   A list of enabled islands sorted by weight.
39   */
40  public function getIslandsByTypes(array $contexts = [], array $configuration = [], array $filter_by_island = []): array;
41
42  /**
43   * Create an island instance for each definition.
44   *
45   * @param array $definitions
46   *   An array of plugin definitions.
47   * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts
48   *   (Optional) An array of contexts, keyed by context name.
49   * @param array $configuration
50   *   (Optional) An array of configuration.
51   *
52   * @return array<string, \Drupal\display_builder\Island\IslandInterface>
53   *   An array of island instances keyed by plugin ID.
54   */
55  public function createInstances(array $definitions, array $contexts = [], array $configuration = []): array;
56
57}