You are here

abstract class ConfigurablePropertyBase in Search API 8

Provides a base class for configurable processor-defined properties.

Hierarchy

Expanded class hierarchy of ConfigurablePropertyBase

3 files declare their use of ConfigurablePropertyBase
AddURLProperty.php in src/Plugin/search_api/processor/Property/AddURLProperty.php
AggregatedFieldProperty.php in src/Plugin/search_api/processor/Property/AggregatedFieldProperty.php
RenderedItemProperty.php in src/Plugin/search_api/processor/Property/RenderedItemProperty.php

File

src/Processor/ConfigurablePropertyBase.php, line 11

Namespace

Drupal\search_api\Processor
View source
abstract class ConfigurablePropertyBase extends ProcessorProperty implements ConfigurablePropertyInterface {

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function validateConfigurationForm(FieldInterface $field, array &$form, FormStateInterface $form_state) {
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(FieldInterface $field, array &$form, FormStateInterface $form_state) {
    $values = array_intersect_key($form_state
      ->getValues(), $this
      ->defaultConfiguration());
    $field
      ->setConfiguration($values);
  }

  /**
   * {@inheritdoc}
   */
  public function getFieldDescription(FieldInterface $field) {
    return $this
      ->getDescription();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurablePropertyBase::defaultConfiguration public function Gets the default configuration for this property. Overrides ConfigurablePropertyInterface::defaultConfiguration 3
ConfigurablePropertyBase::getFieldDescription public function Retrieves the description for a field based on this property. Overrides ConfigurablePropertyInterface::getFieldDescription 1
ConfigurablePropertyBase::submitConfigurationForm public function Submits a configuration form for a field based on this property. Overrides ConfigurablePropertyInterface::submitConfigurationForm 1
ConfigurablePropertyBase::validateConfigurationForm public function Validates a configuration form for a field based on this property. Overrides ConfigurablePropertyInterface::validateConfigurationForm
ConfigurablePropertyInterface::buildConfigurationForm public function Constructs a configuration form for a field based on this property. 3
DataDefinition::$definition protected property The array holding values for all definition keys.
DataDefinition::addConstraint public function Adds a validation constraint. Overrides DataDefinitionInterface::addConstraint
DataDefinition::create public static function Creates a new data definition. 5
DataDefinition::createFromDataType public static function Creates a new data definition object. Overrides DataDefinitionInterface::createFromDataType 5
DataDefinition::getClass public function Returns the class used for creating the typed data object. Overrides DataDefinitionInterface::getClass 1
DataDefinition::getConstraint public function Returns a validation constraint. Overrides DataDefinitionInterface::getConstraint
DataDefinition::getConstraints public function Returns an array of validation constraints. Overrides DataDefinitionInterface::getConstraints 1
DataDefinition::getDataType public function Returns the data type of the data. Overrides DataDefinitionInterface::getDataType 2
DataDefinition::getDescription public function Returns a human readable description. Overrides DataDefinitionInterface::getDescription
DataDefinition::getLabel public function Returns a human readable label. Overrides DataDefinitionInterface::getLabel
DataDefinition::getSetting public function Returns the value of a given setting. Overrides DataDefinitionInterface::getSetting 2
DataDefinition::getSettings public function Returns the array of settings, as required by the used class. Overrides DataDefinitionInterface::getSettings 2
DataDefinition::isComputed public function Determines whether the data value is computed. Overrides DataDefinitionInterface::isComputed
DataDefinition::isInternal public function Determines whether the data value is internal. Overrides DataDefinitionInterface::isInternal 1
DataDefinition::isReadOnly public function Determines whether the data is read-only. Overrides DataDefinitionInterface::isReadOnly
DataDefinition::isRequired public function Determines whether a data value is required. Overrides DataDefinitionInterface::isRequired
DataDefinition::offsetExists public function This is for BC support only. @todo: Remove in https://www.drupal.org/node/1928868.
DataDefinition::offsetGet public function This is for BC support only. @todo: Remove in https://www.drupal.org/node/1928868.
DataDefinition::offsetSet public function This is for BC support only. @todo: Remove in https://www.drupal.org/node/1928868.
DataDefinition::offsetUnset public function This is for BC support only. @todo: Remove in https://www.drupal.org/node/1928868.
DataDefinition::setClass public function Sets the class used for creating the typed data object.
DataDefinition::setComputed public function Sets whether the data is computed.
DataDefinition::setConstraints public function Sets an array of validation constraints.
DataDefinition::setDataType public function Sets the data type. 1
DataDefinition::setDescription public function Sets the human-readable description.
DataDefinition::setInternal public function Sets the whether the data value should be internal.
DataDefinition::setLabel public function Sets the human-readable label.
DataDefinition::setReadOnly public function Sets whether the data is read-only.
DataDefinition::setRequired public function Sets whether the data is required.
DataDefinition::setSetting public function Sets a definition setting. 2
DataDefinition::setSettings public function Sets the array of settings, as required by the used class. 2
DataDefinition::toArray public function Returns all definition values as array.
DataDefinition::__construct public function Constructs a new data definition object. 1
DataDefinition::__sleep public function 2
ProcessorProperty::getProcessorId public function Retrieves the ID of the processor which defines this property. Overrides ProcessorPropertyInterface::getProcessorId
ProcessorProperty::isHidden public function Determines whether this property should be hidden from the UI. Overrides ProcessorPropertyInterface::isHidden
ProcessorProperty::isList public function Returns whether the data is multi-valued, i.e. a list of data items. Overrides DataDefinition::isList
TypedDataTrait::$typedDataManager protected property The typed data manager used for creating the data types.
TypedDataTrait::getTypedDataManager public function Gets the typed data manager. 2
TypedDataTrait::setTypedDataManager public function Sets the typed data manager. 2