You are here

interface BackendInterface in Search API 8

Defines an interface for search backend plugins.

Consists of general plugin methods and the backend-specific methods defined in \Drupal\search_api\Backend\BackendSpecificInterface, as well as special CRUD "hook" methods that cannot be present on the server entity (which also implements \Drupal\search_api\Backend\BackendSpecificInterface).

Hierarchy

Expanded class hierarchy of BackendInterface

All classes that implement BackendInterface

See also

\Drupal\search_api\Annotation\SearchApiBackend

\Drupal\search_api\Backend\BackendPluginManager

\Drupal\search_api\Backend\BackendPluginBase

Plugin API

2 files declare their use of BackendInterface
ConfigOverrideKernelTest.php in tests/src/Kernel/ConfigEntity/ConfigOverrideKernelTest.php
MethodOverrides.php in tests/search_api_test/src/MethodOverrides.php

File

src/Backend/BackendInterface.php, line 21

Namespace

Drupal\search_api\Backend
View source
interface BackendInterface extends ConfigurablePluginInterface, BackendSpecificInterface {

  /**
   * Retrieves the server entity for this backend.
   *
   * @return \Drupal\search_api\ServerInterface
   *   The server entity.
   */
  public function getServer();

  /**
   * Sets the server entity for this backend.
   *
   * @param \Drupal\search_api\ServerInterface $server
   *   The server entity.
   *
   * @return $this
   */
  public function setServer(ServerInterface $server);

  /**
   * Reacts to the server's creation.
   *
   * Called once, when the server is first created. Allows the backend class to
   * set up its necessary infrastructure.
   */
  public function postInsert();

  /**
   * Notifies the backend that its configuration is about to be updated.
   *
   * The server's $original property can be used to inspect the old
   * configuration values.
   *
   * Take care, though, that the server at this point might be override-free and
   * thus contain property values (and apparent changes) which will not actually
   * go into effect. If this might influence the code in this method, you have
   * to manually check for overrides to ensure no incorrect action is taken.
   *
   * @see \Drupal\search_api\Utility\Utility::getConfigOverrides()
   */
  public function preUpdate();

  /**
   * Notifies the backend that its configuration was updated.
   *
   * The server's $original property can be used to inspect the old
   * configuration values.
   *
   * @return bool
   *   TRUE, if the update requires reindexing of all content on the server.
   */
  public function postUpdate();

  /**
   * Notifies the backend that the server is about to be deleted.
   *
   * This should execute any necessary cleanup operations.
   *
   * Note that you shouldn't call the server's save() method, or any
   * methods that might do that, from inside of this method as the server isn't
   * present in the database anymore at this point.
   */
  public function preDelete();

}

Members

Namesort descending Modifiers Type Description Overrides
BackendInterface::getServer public function Retrieves the server entity for this backend. 1
BackendInterface::postInsert public function Reacts to the server's creation. 1
BackendInterface::postUpdate public function Notifies the backend that its configuration was updated. 1
BackendInterface::preDelete public function Notifies the backend that the server is about to be deleted. 1
BackendInterface::preUpdate public function Notifies the backend that its configuration is about to be updated. 1
BackendInterface::setServer public function Sets the server entity for this backend. 1
BackendSpecificInterface::addIndex public function Adds a new index to this server. 2
BackendSpecificInterface::deleteAllIndexItems public function Deletes all the items from the index. 4
BackendSpecificInterface::deleteItems public function Deletes the specified items from the index. 4
BackendSpecificInterface::getBackendDefinedFields public function Provides information on additional fields made available by the backend. 2
BackendSpecificInterface::getDiscouragedProcessors public function Limits the processors displayed in the UI for indexes on this server. 2
BackendSpecificInterface::getSupportedFeatures public function Returns all features that this backend supports. 2
BackendSpecificInterface::indexItems public function Indexes the specified items. 4
BackendSpecificInterface::isAvailable public function Returns a boolean with the availability of the backend. 2
BackendSpecificInterface::removeIndex public function Removes an index from this server. 2
BackendSpecificInterface::search public function Executes a search on this server. 4
BackendSpecificInterface::supportsDataType public function Determines whether the backend supports a given add-on data type. 2
BackendSpecificInterface::updateIndex public function Notifies the server that an index attached to it has been changed. 2
BackendSpecificInterface::viewSettings public function Returns additional, backend-specific information about this server. 2
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
ConfigurablePluginInterface::getDescription public function Returns the plugin's description. 1
ConfigurablePluginInterface::label public function Returns the label for use on the administration pages. 1
ConfigurablePluginInterface::onDependencyRemoval public function Informs the plugin that some of its dependencies are being removed. 1
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
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