You are here

interface DataTypeInterface in Search API 8

Defines an interface for data type plugins.

Hierarchy

Expanded class hierarchy of DataTypeInterface

All classes that implement DataTypeInterface

See also

\Drupal\search_api\Annotation\SearchApiDataType

\Drupal\search_api\DataType\DataTypePluginManager

\Drupal\search_api\DataType\DataTypePluginBase

Plugin API

2 files declare their use of DataTypeInterface
AggregatedFieldsTest.php in tests/src/Unit/Processor/AggregatedFieldsTest.php
ItemFieldTest.php in tests/src/Unit/ItemFieldTest.php

File

src/DataType/DataTypeInterface.php, line 18

Namespace

Drupal\search_api\DataType
View source
interface DataTypeInterface extends HideablePluginInterface, PluginInspectionInterface, DerivativeInspectionInterface, ContainerFactoryPluginInterface {

  /**
   * Returns the label of the data type.
   *
   * @return string
   *   The administration label.
   */
  public function label();

  /**
   * Returns the description of the data type.
   */
  public function getDescription();

  /**
   * Converts a field value to match the data type (if needed).
   *
   * @param mixed $value
   *   The value to convert.
   *
   * @return mixed
   *   The converted value.
   */
  public function getValue($value);

  /**
   * Returns the fallback default data type for this data type.
   *
   * @return string
   *   The fallback default data type.
   */
  public function getFallbackType();

  /**
   * Determines whether this data type is a default data type.
   *
   * Default data types are provided by the Search API module itself and have to
   * be supported by all backends. They therefore are the only ones that can be
   * used as a fallback for other data types, and don't need to have a fallback
   * type themselves.
   *
   * @return bool
   *   TRUE if the data type is a default type, FALSE otherwise.
   */
  public function isDefault();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DataTypeInterface::getDescription public function Returns the description of the data type. 1
DataTypeInterface::getFallbackType public function Returns the fallback default data type for this data type. 1
DataTypeInterface::getValue public function Converts a field value to match the data type (if needed). 1
DataTypeInterface::isDefault public function Determines whether this data type is a default data type. 1
DataTypeInterface::label public function Returns the label of the data type. 1
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
HideablePluginInterface::isHidden public function Determines whether this plugin should be hidden in the UI. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2