ProcessorPluginBase.php in Facets 8
File
modules/facets_summary/src/Processor/ProcessorPluginBase.php
View source
<?php
namespace Drupal\facets_summary\Processor;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\facets_summary\FacetsSummaryInterface;
class ProcessorPluginBase extends PluginBase implements ProcessorInterface {
public function buildConfigurationForm(array $form, FormStateInterface $form_state, FacetsSummaryInterface $facets_summary) {
return [];
}
public function validateConfigurationForm(array $form, FormStateInterface $form_state, FacetsSummaryInterface $facets_summary) {
}
public function submitConfigurationForm(array $form, FormStateInterface $form_state, FacetsSummaryInterface $facets_summary) {
$this
->setConfiguration($form_state
->getValues());
}
public function supportsStage($stage_identifier) {
$plugin_definition = $this
->getPluginDefinition();
return isset($plugin_definition['stages'][$stage_identifier]);
}
public function getDefaultWeight($stage) {
$plugin_definition = $this
->getPluginDefinition();
return isset($plugin_definition['stages'][$stage]) ? (int) $plugin_definition['stages'][$stage] : 0;
}
public function isLocked() {
return !empty($this->pluginDefinition['locked']);
}
public function isHidden() {
return !empty($this->pluginDefinition['hidden']);
}
public function getDescription() {
$plugin_definition = $this
->getPluginDefinition();
return isset($plugin_definition['description']) ? $plugin_definition['description'] : '';
}
public function defaultConfiguration() {
return [];
}
public function getConfiguration() {
unset($this->configuration['facets_summary']);
return $this->configuration + $this
->defaultConfiguration();
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function calculateDependencies() {
$this
->addDependency('module', $this
->getPluginDefinition()['provider']);
return $this->dependencies;
}
}