You are here

class MappedTermsProperty in Search API Field Map 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/Property/MappedTermsProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedTermsProperty
  2. 8 src/Plugin/search_api/processor/Property/MappedTermsProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedTermsProperty
  3. 8.2 src/Plugin/search_api/processor/Property/MappedTermsProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedTermsProperty

Defines an "mapped terms" property.

Hierarchy

Expanded class hierarchy of MappedTermsProperty

See also

\Drupal\search_api_field_map\Plugin\search_api\processor\MappedTerms

1 file declares its use of MappedTermsProperty
MappedTerms.php in src/Plugin/search_api/processor/MappedTerms.php

File

src/Plugin/search_api/processor/Property/MappedTermsProperty.php, line 15

Namespace

Drupal\search_api_field_map\Plugin\search_api\processor\Property
View source
class MappedTermsProperty extends ConfigurablePropertyBase {
  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [
      'type' => 'union',
      'fields' => [],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(FieldInterface $field, array $form, FormStateInterface $form_state) {
    $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css';
    $form['#tree'] = TRUE;
    $form['field_data'] = [
      '#type' => 'item',
      '#title' => $this
        ->t('Mapped terms'),
      '#description' => $this
        ->t('By adding this field to your search index configuration, you have enabled the mapped terms processor to run when new items are indexed.  Next, add a "Mapped Terms" field to any taxonomy vocabulary whose terms should be mapped to a "mapped" term (this helps map terms across vocabularies and sites to a single "mapped" term).  Then, edit terms in those vocabularies to add the mapped term destination value (i.e. "Conditions>Blood Disorders").  Once that tagged content gets indexed, it will have "mapped_terms" populated with any matching mapped term destination values.'),
    ];
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MappedTermsProperty::buildConfigurationForm public function
MappedTermsProperty::defaultConfiguration public function
StringTranslationTrait::$stringTranslation protected property The string translation service. 4
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.