You are here

public function ImportProcessorPluginBase::getWeight in Entity Share 8.3

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 ImportProcessorInterface::getWeight

See also

\Drupal\entity_share_client\ImportProcessor\ImportProcessorPluginManager::getProcessingStages()

File

modules/entity_share_client/src/ImportProcessor/ImportProcessorPluginBase.php, line 120

Class

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

Namespace

Drupal\entity_share_client\ImportProcessor

Code

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