You are here

interface DataTypeHelperInterface in Search API 8

Provides an interface for implementations of the data type helper service.

Hierarchy

Expanded class hierarchy of DataTypeHelperInterface

All classes that implement DataTypeHelperInterface

6 files declare their use of DataTypeHelperInterface
FieldsHelperTest.php in tests/src/Unit/FieldsHelperTest.php
FieldsProcessorPluginBase.php in src/Processor/FieldsProcessorPluginBase.php
Highlight.php in src/Plugin/search_api/processor/Highlight.php
HtmlFilter.php in src/Plugin/search_api/processor/HtmlFilter.php
IndexAddFieldsForm.php in src/Form/IndexAddFieldsForm.php

... See full list

File

src/Utility/DataTypeHelperInterface.php, line 10

Namespace

Drupal\search_api\Utility
View source
interface DataTypeHelperInterface {

  /**
   * Determines whether fields of the given type contain fulltext data.
   *
   * @param string $type
   *   The type to check.
   * @param string[] $textTypes
   *   (optional) An array of types to be considered as text.
   *
   * @return bool
   *   TRUE if $type is one of the specified types, FALSE otherwise.
   */
  public function isTextType($type, array $textTypes = [
    'text',
  ]);

  /**
   * Retrieves the mapping for known data types to Search API's internal types.
   *
   * @return string[]
   *   An array mapping all known (and supported) Drupal data types to their
   *   corresponding Search API data types. Empty values mean that fields of
   *   that type should be ignored by the Search API.
   *
   * @see hook_search_api_field_type_mapping_alter()
   */
  public function getFieldTypeMapping();

  /**
   * Retrieves the necessary type fallbacks for an index.
   *
   * @param \Drupal\search_api\IndexInterface $index
   *   The index for which to return the type fallbacks.
   *
   * @return string[]
   *   An array containing the IDs of all custom data types that are not
   *   supported by the index's current server, mapped to their fallback types.
   */
  public function getDataTypeFallbackMapping(IndexInterface $index);

}

Members

Namesort descending Modifiers Type Description Overrides
DataTypeHelperInterface::getDataTypeFallbackMapping public function Retrieves the necessary type fallbacks for an index. 1
DataTypeHelperInterface::getFieldTypeMapping public function Retrieves the mapping for known data types to Search API's internal types. 1
DataTypeHelperInterface::isTextType public function Determines whether fields of the given type contain fulltext data. 1