You are here

public function ProcessorPluginBase::getWeight in Search API 8

Returns the weight for a specific processing stage.

Parameters

string $stage: The stage whose weight should be returned.

Return value

int The default weight for the given stage.

Overrides ProcessorInterface::getWeight

See also

\Drupal\search_api\Processor\ProcessorPluginManager::getProcessingStages()

File

src/Processor/ProcessorPluginBase.php, line 114

Class

ProcessorPluginBase
Defines a base class from which other processors may extend.

Namespace

Drupal\search_api\Processor

Code

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