You are here

public function DummyFields::getPropertyDefinitions in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::getPropertyDefinitions()
  2. 8.2 src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::getPropertyDefinitions()

File

src/Plugin/search_api/processor/DummyFields.php, line 29

Class

DummyFields
Adds dummy fields to the indexed data.

Namespace

Drupal\search_api_solr\Plugin\search_api\processor

Code

public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) {
  $properties = [];
  if ($datasource) {
    $definition = [
      'label' => $this
        ->t('Dummy field'),
      'description' => $this
        ->t('Adds dummy field that gets its values via API, for example hook_search_api_solr_documents_alter().'),
      'type' => 'string',
      'processor_id' => $this
        ->getPluginId(),
      'is_list' => TRUE,
    ];
    $properties['dummy_field'] = new DummyFieldProperty($definition);
  }
  return $properties;
}