You are here

public function SocialMediaLinksIconsetManager::getIconsets in Social Media Links Block and Field 8.2

Get all iconset plugins.

Return value

array The iconset plugins.

1 call to SocialMediaLinksIconsetManager::getIconsets()
SocialMediaLinksIconsetManager::getStyles in src/SocialMediaLinksIconsetManager.php
Return a array with the available styles for each (available) iconset.

File

src/SocialMediaLinksIconsetManager.php, line 38

Class

SocialMediaLinksIconsetManager
Manager class for the iconset plugins.

Namespace

Drupal\social_media_links

Code

public function getIconsets() {
  $plugins = $this
    ->getDefinitions();
  foreach ($plugins as $plugin_id => $plugin) {
    $instance = $this
      ->createInstance($plugin_id);
    if ($instance instanceof IconsetInterface) {

      // Attach the class instance to the plugin definitions.
      $plugins[$plugin_id]['instance'] = $instance;
    }
    else {
      $plugins[$plugin_id] = [];
    }
  }
  return $plugins;
}