You are here

interface ProcessorInterface in Facets 8

Same name in this branch
  1. 8 src/Processor/ProcessorInterface.php \Drupal\facets\Processor\ProcessorInterface
  2. 8 modules/facets_summary/src/Processor/ProcessorInterface.php \Drupal\facets_summary\Processor\ProcessorInterface

Describes a processor.

Hierarchy

Expanded class hierarchy of ProcessorInterface

All classes that implement ProcessorInterface

4 files declare their use of ProcessorInterface
DefaultFacetManager.php in src/FacetManager/DefaultFacetManager.php
FacetForm.php in src/Form/FacetForm.php
FacetTest.php in tests/src/Kernel/Entity/FacetTest.php
ProcessorPluginManagerTest.php in tests/src/Unit/Processor/ProcessorPluginManagerTest.php

File

src/Processor/ProcessorInterface.php, line 14

Namespace

Drupal\facets\Processor
View source
interface ProcessorInterface extends ConfigurableInterface, DependentPluginInterface, PluginInspectionInterface {

  /**
   * Processing stage: pre_query.
   */
  const STAGE_PRE_QUERY = 'pre_query';

  /**
   * Processing stage: post_query.
   */
  const STAGE_POST_QUERY = 'post_query';

  /**
   * Processing stage: build.
   */
  const STAGE_BUILD = 'build';

  /**
   * Processing stage: sort.
   */
  const STAGE_SORT = 'sort';

  /**
   * Adds a configuration form for this processor.
   *
   * @param array $form
   *   The form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current form state.
   * @param \Drupal\facets\FacetInterface $facet
   *   The facet this processor is being added to.
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state, FacetInterface $facet);

  /**
   * Validates a configuration form for this processor.
   *
   * @param array $form
   *   The form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current form state.
   * @param \Drupal\facets\FacetInterface $facet
   *   The facet this processor is being added to.
   */
  public function validateConfigurationForm(array $form, FormStateInterface $form_state, FacetInterface $facet);

  /**
   * Checks whether this processor implements a particular stage.
   *
   * @param string $stage_identifier
   *   The stage to check: self::STAGE_PRE_QUERY,
   *   self::STAGE_POST_QUERY
   *   or self::STAGE_BUILD.
   *
   * @return bool
   *   TRUE if the processor runs on a particular stage; FALSE otherwise.
   */
  public function supportsStage($stage_identifier);

  /**
   * Returns the default weight for a specific processing stage.
   *
   * Some processors should ensure they run earlier or later in a particular
   * stage. Processors with lower weights are run earlier. The default value is
   * used when the processor is first enabled. It can then be changed through
   * reordering by the user.
   *
   * @param string $stage
   *   The stage whose default weight should be returned. See
   *   \Drupal\facets\Processor\ProcessorPluginManager::getProcessingStages()
   *   for the valid values.
   *
   * @return int
   *   The default weight for the given stage.
   */
  public function getDefaultWeight($stage);

  /**
   * Determines whether this processor should always be enabled.
   *
   * @return bool
   *   TRUE if this processor should be forced enabled; FALSE otherwise.
   */
  public function isLocked();

  /**
   * Determines whether this processor should be hidden from the user.
   *
   * @return bool
   *   TRUE if this processor should be hidden from the user; FALSE otherwise.
   */
  public function isHidden();

  /**
   * Retrieves the processor description.
   *
   * @return string
   *   The description of this processor.
   */
  public function getDescription();

  /**
   * Checks if the facet is supported by this widget.
   *
   * Reasons why this would be unsupported can be chosen by the widget.
   *
   * @param \Drupal\facets\FacetInterface $facet
   *   The facet to check for.
   *
   * @return bool
   *   Returns true when allowed, false otherwise.
   *
   * @see \Drupal\facets\Widget\WidgetPluginInterface::supportsFacet
   */
  public function supportsFacet(FacetInterface $facet);

  /**
   * Picks the preferred query type for this widget.
   *
   * @return string|null
   *   The query type machine name to load or NULL to load the default query
   *   type.
   */
  public function getQueryType();

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ProcessorInterface::buildConfigurationForm public function Adds a configuration form for this processor. 2
ProcessorInterface::getDefaultWeight public function Returns the default weight for a specific processing stage. 2
ProcessorInterface::getDescription public function Retrieves the processor description. 2
ProcessorInterface::getQueryType public function Picks the preferred query type for this widget. 1
ProcessorInterface::isHidden public function Determines whether this processor should be hidden from the user. 2
ProcessorInterface::isLocked public function Determines whether this processor should always be enabled. 2
ProcessorInterface::STAGE_BUILD constant Processing stage: build.
ProcessorInterface::STAGE_POST_QUERY constant Processing stage: post_query.
ProcessorInterface::STAGE_PRE_QUERY constant Processing stage: pre_query.
ProcessorInterface::STAGE_SORT constant Processing stage: sort.
ProcessorInterface::supportsFacet public function Checks if the facet is supported by this widget. 1
ProcessorInterface::supportsStage public function Checks whether this processor implements a particular stage. 2
ProcessorInterface::validateConfigurationForm public function Validates a configuration form for this processor. 2