SharePluginManager.php in Share Message 8
File
src/SharePluginManager.php
View source
<?php
namespace Drupal\sharemessage;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class SharePluginManager extends DefaultPluginManager {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/sharemessage', $namespaces, $module_handler, 'Drupal\\sharemessage\\SharePluginInterface', 'Drupal\\sharemessage\\Annotation\\SharePlugin');
$this
->alterInfo('sharemessage_share_plugin_info');
$this
->setCacheBackend($cache_backend, 'sharemessage_share_plugin');
}
public function getLabels() {
$list = [];
foreach ($this
->getDefinitions() as $plugin => $definition) {
$list[$plugin] = $definition['label'];
}
return $list;
}
}