You are here

public function Facet::addProcessor in Facets 8

Adds a processor for this facet.

Parameters

array $processor: An array definition for a processor.

Overrides FacetInterface::addProcessor

File

src/Entity/Facet.php, line 909

Class

Facet
Defines the facet configuration entity.

Namespace

Drupal\facets\Entity

Code

public function addProcessor(array $processor) {
  $this->processor_configs[$processor['processor_id']] = [
    'processor_id' => $processor['processor_id'],
    'weights' => $processor['weights'],
    'settings' => $processor['settings'],
  ];

  // Sort the processors so we won't have unnecessary changes.
  ksort($this->processor_configs);
}