2021-07-15 20:55:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Drupal\farm_quick;
|
|
|
|
|
|
|
|
use Drupal\Core\Cache\CacheBackendInterface;
|
|
|
|
use Drupal\Core\Extension\ModuleHandlerInterface;
|
2023-06-13 18:53:49 +02:00
|
|
|
use Drupal\Core\Plugin\DefaultPluginManager;
|
2021-07-15 20:55:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Quick form manager class.
|
|
|
|
*/
|
2023-08-03 21:32:15 +02:00
|
|
|
class QuickFormPluginManager extends DefaultPluginManager {
|
2021-07-15 20:55:12 +02:00
|
|
|
|
|
|
|
/**
|
2023-08-03 21:32:15 +02:00
|
|
|
* Constructs a QuickFormPluginManager object.
|
2021-07-15 20:55:12 +02:00
|
|
|
*
|
|
|
|
* @param \Traversable $namespaces
|
|
|
|
* An object that implements \Traversable which contains the root paths
|
|
|
|
* keyed by the corresponding namespace to look for plugin implementations.
|
|
|
|
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
|
|
|
|
* Cache backend instance to use.
|
|
|
|
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
|
|
|
|
* The module handler to invoke the alter hook with.
|
|
|
|
*/
|
|
|
|
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
|
|
|
|
parent::__construct(
|
2021-10-26 00:30:16 +02:00
|
|
|
'Plugin/QuickForm',
|
2021-07-15 20:55:12 +02:00
|
|
|
$namespaces,
|
|
|
|
$module_handler,
|
2021-10-27 18:01:44 +02:00
|
|
|
'Drupal\farm_quick\Plugin\QuickForm\QuickFormInterface',
|
2021-07-15 20:55:12 +02:00
|
|
|
'Drupal\farm_quick\Annotation\QuickForm'
|
|
|
|
);
|
|
|
|
$this->alterInfo('quick_form_info');
|
|
|
|
$this->setCacheBackend($cache_backend, 'quick_forms');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|