You are here

public function FlagIndexer::getPropertyDefinitions in Flag Search API 8

Retrieves the properties this processor defines for the given datasource.

Property names have to start with a letter or an underscore, followed by any number of letters, numbers and underscores. To avoid collisions, it is also recommended to prefix the property name with the identifier of the module defining the processor.

Parameters

\Drupal\search_api\Datasource\DatasourceInterface|null $datasource: (optional) The datasource this set of properties belongs to. If NULL, the datasource-independent properties should be added (or modified).

Return value

\Drupal\search_api\Processor\ProcessorPropertyInterface[] An array of property definitions for that datasource, keyed by property names.

Overrides ProcessorPluginBase::getPropertyDefinitions

File

src/Plugin/search_api/processor/FlagIndexer.php, line 120

Class

FlagIndexer
Search API Processor for indexing flags.

Namespace

Drupal\flag_search_api\Plugin\search_api\processor

Code

public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) {
  $properties = array();
  if (!$datasource) {

    // Ensure that our fields are defined.
    $fields = $this
      ->getFieldsDefinition();
    foreach ($fields as $field_id => $field_definition) {
      $properties[$field_id] = new ProcessorProperty($field_definition);
    }
  }
  return $properties;
}