You are here

public function SettingPluginManager::getDefinitions in Fasttoggle 8.2

Gets the definition of all plugins for this type.

Return value

mixed[] An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

Overrides DefaultPluginManager::getDefinitions

See also

\Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()

File

src/SettingPluginManager.php, line 72
Contains \Drupal\fasttoggle\FasttoggleObjectPluginManager.

Class

SettingPluginManager
Manages Fasttoggle Setting plugins.

Namespace

Drupal\fasttoggle

Code

public function getDefinitions() {
  $definitions = parent::getDefinitions();
  $result = [];
  foreach ($definitions as $setting => $definition) {
    $entityType = $definition['entityType'];
    $group = $definition['group'];
    if (!isset($result[$entityType])) {
      $result[$entityType] = [];
    }
    if (!isset($result[$entityType][$group])) {
      $result[$entityType][$group] = [];
    }
    $result[$entityType][$group][$setting] = $definition;
  }
  return $result;
}