AutomatedCropManager.php in Automated Crop 8
File
src/AutomatedCropManager.php
View source
<?php
namespace Drupal\automated_crop;
use Drupal\Component\Plugin\FallbackPluginManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class AutomatedCropManager extends DefaultPluginManager implements FallbackPluginManagerInterface {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/AutomatedCrop', $namespaces, $module_handler, 'Drupal\\automated_crop\\AutomatedCropInterface', 'Drupal\\automated_crop\\Annotation\\AutomatedCrop');
$this
->alterInfo('automated_crop_info');
$this
->setCacheBackend($cache_backend, 'automated_crop_plugins');
}
public function getFallbackPluginId($plugin_id, array $configuration = []) {
return 'automated_crop_default';
}
public function getProviderOptionsList() {
$options = [];
$plugin_definitions = $this
->getDefinitions();
foreach ($plugin_definitions as $name => $plugin) {
$options[$name] = $plugin['label'];
}
return $options;
}
}