You are here

public function ProcessorPluginBase::getDefaultWeight in Facets 8

Same name in this branch
  1. 8 src/Processor/ProcessorPluginBase.php \Drupal\facets\Processor\ProcessorPluginBase::getDefaultWeight()
  2. 8 modules/facets_summary/src/Processor/ProcessorPluginBase.php \Drupal\facets_summary\Processor\ProcessorPluginBase::getDefaultWeight()

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.

Parameters

string $stage: The stage whose default weight should be returned. See \Drupal\facets\Processor\ProcessorPluginManager::getProcessingStages() for the valid values.

Return value

int The default weight for the given stage.

Overrides ProcessorInterface::getDefaultWeight

File

src/Processor/ProcessorPluginBase.php, line 53

Class

ProcessorPluginBase
A base class for plugins that implements most of the boilerplate.

Namespace

Drupal\facets\Processor

Code

public function getDefaultWeight($stage) {
  $plugin_definition = $this
    ->getPluginDefinition();
  return isset($plugin_definition['stages'][$stage]) ? (int) $plugin_definition['stages'][$stage] : 0;
}