ProcessorPluginManager.php in Facets 8
File
src/Processor/ProcessorPluginManager.php
View source
<?php
namespace Drupal\facets\Processor;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\facets\Annotation\FacetsProcessor;
class ProcessorPluginManager extends DefaultPluginManager {
use StringTranslationTrait;
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, TranslationInterface $translation) {
parent::__construct('Plugin/facets/processor', $namespaces, $module_handler, ProcessorInterface::class, FacetsProcessor::class);
$this
->setCacheBackend($cache_backend, 'facets_processors');
$this
->setStringTranslation($translation);
}
public function getProcessingStages() {
return [
ProcessorInterface::STAGE_PRE_QUERY => [
'label' => $this
->t('Pre query stage'),
],
ProcessorInterface::STAGE_POST_QUERY => [
'label' => $this
->t('Post query stage'),
],
ProcessorInterface::STAGE_BUILD => [
'label' => $this
->t('Build stage'),
],
ProcessorInterface::STAGE_SORT => [
'label' => $this
->t('Sort stage'),
],
];
}
}