You are here

class CustomTextDataType in Search API Solr 8.3

Same name in this branch
  1. 8.3 src/Plugin/Derivative/CustomTextDataType.php \Drupal\search_api_solr\Plugin\Derivative\CustomTextDataType
  2. 8.3 src/Plugin/search_api/data_type/CustomTextDataType.php \Drupal\search_api_solr\Plugin\search_api\data_type\CustomTextDataType
Same name and namespace in other branches
  1. 8.2 src/Plugin/Derivative/CustomTextDataType.php \Drupal\search_api_solr\Plugin\Derivative\CustomTextDataType
  2. 4.x src/Plugin/Derivative/CustomTextDataType.php \Drupal\search_api_solr\Plugin\Derivative\CustomTextDataType

Provides plugin definitions for custom full text data types.

Hierarchy

Expanded class hierarchy of CustomTextDataType

See also

\Drupal\search_api_solr\Plugin\search_api\data_type\CustomTextDataType

File

src/Plugin/Derivative/CustomTextDataType.php, line 16

Namespace

Drupal\search_api_solr\Plugin\Derivative
View source
class CustomTextDataType extends DeriverBase implements ContainerDeriverInterface {
  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static();
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    foreach (SolrFieldType::getAvailableCustomCodes() as $custom_code) {
      $this->derivatives[$custom_code] = $base_plugin_definition;
      $this->derivatives[$custom_code]['label'] = $this
        ->t('Fulltext ":custom_code"', [
        ':custom_code' => $custom_code,
      ]);
      $this->derivatives[$custom_code]['prefix'] .= $custom_code;
    }
    return $this->derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CustomTextDataType::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
CustomTextDataType::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
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.