ContentProcessorPluginManager.php in YAML Content 8.2
File
src/ContentProcessorPluginManager.php
View source
<?php
namespace Drupal\yaml_content;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class ContentProcessorPluginManager extends DefaultPluginManager implements ContentProcessorPluginManagerInterface {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
$subdir = 'Plugin/YamlContent';
$plugin_interface = 'Drupal\\yaml_content\\ContentProcessorInterface';
$plugin_definition_annotation_name = 'Drupal\\yaml_content\\Annotation\\ContentProcessor';
parent::__construct($subdir, $namespaces, $module_handler, $plugin_interface, $plugin_definition_annotation_name);
$this
->alterInfo('yaml_content_processor_info');
$this
->setCacheBackend($cache_backend, 'yaml_content_processor_info');
}
public function getImportPlugins() {
$all_plugins = $this
->getDefinitions();
$import_plugins = [];
foreach ($all_plugins as $plugin) {
if ($plugin['import']) {
$import_plugins[] = $plugin;
}
}
return $import_plugins;
}
public function getExportPlugins() {
$all_plugins = $this
->getDefinitions();
$export_plugins = [];
foreach ($all_plugins as $plugin) {
if ($plugin['export']) {
$export_plugins[] = $plugin;
}
}
return $export_plugins;
}
}