class ConfigurableSearchPluginBase

Provides a base implementation for a configurable Search plugin.

Hierarchy

Expanded class hierarchy of ConfigurableSearchPluginBase

3 files declare their use of ConfigurableSearchPluginBase
EntitySearchPage.php in core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php
NodeSearch.php in core/modules/node/src/Plugin/Search/NodeSearch.php
SearchExtraTypeSearch.php in core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php

File

core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php, line 11

Namespace

Drupal\search\Plugin
View source
abstract class ConfigurableSearchPluginBase extends SearchPluginBase implements ConfigurableSearchPluginInterface {
  
  /**
   * The unique ID for the search page using this plugin.
   *
   * @var string
   */
  protected $searchPageId;
  
  /**
   * {@inheritdoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->setConfiguration($configuration);
  }
  
  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [];
  }
  
  /**
   * {@inheritdoc}
   */
  public function getConfiguration() {
    return $this->configuration;
  }
  
  /**
   * {@inheritdoc}
   */
  public function setConfiguration(array $configuration) {
    $this->configuration = NestedArray::mergeDeep($this->defaultConfiguration(), $configuration);
  }
  
  /**
   * {@inheritdoc}
   */
  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  }
  
  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    return [];
  }
  
  /**
   * {@inheritdoc}
   */
  public function setSearchPageId($search_page_id) {
    $this->searchPageId = $search_page_id;
    return $this;
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 4
CacheableDependencyTrait::getCacheMaxAge public function 4
CacheableDependencyTrait::getCacheTags public function 4
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigurableSearchPluginBase::$searchPageId protected property The unique ID for the search page using this plugin.
ConfigurableSearchPluginBase::calculateDependencies public function Overrides DependentPluginInterface::calculateDependencies
ConfigurableSearchPluginBase::defaultConfiguration public function Overrides ConfigurableInterface::defaultConfiguration 2
ConfigurableSearchPluginBase::getConfiguration public function Overrides ConfigurableInterface::getConfiguration
ConfigurableSearchPluginBase::setConfiguration public function Overrides ConfigurableInterface::setConfiguration
ConfigurableSearchPluginBase::setSearchPageId public function Overrides ConfigurableSearchPluginInterface::setSearchPageId
ConfigurableSearchPluginBase::validateConfigurationForm public function Overrides PluginFormInterface::validateConfigurationForm
ConfigurableSearchPluginBase::__construct public function Overrides PluginBase::__construct 1
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 2
DependencySerializationTrait::__wakeup public function #[\ReturnTypeWillChange] 2
MessengerTrait::$messenger protected property The messenger. 25
MessengerTrait::messenger public function Gets the messenger. 25
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin ID.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Overrides PluginInspectionInterface::getPluginDefinition 2
PluginBase::getPluginId public function Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginFormInterface::buildConfigurationForm public function Form constructor. 46
PluginFormInterface::submitConfigurationForm public function Form submission handler. 41
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SearchInterface::execute public function Executes the search. 4
SearchPluginBase::$keywords protected property The keywords to use in a search.
SearchPluginBase::$searchAttributes protected property Array of attributes - usually from the request object.
SearchPluginBase::$searchParameters protected property Array of parameters from the query string from the request.
SearchPluginBase::buildResults public function Overrides SearchInterface::buildResults 1
SearchPluginBase::buildSearchUrlQuery public function Overrides SearchInterface::buildSearchUrlQuery 1
SearchPluginBase::create public static function Overrides ContainerFactoryPluginInterface::create 3
SearchPluginBase::getAttributes public function Overrides SearchInterface::getAttributes
SearchPluginBase::getHelp public function Overrides SearchInterface::getHelp 1
SearchPluginBase::getKeywords public function Overrides SearchInterface::getKeywords
SearchPluginBase::getParameters public function Overrides SearchInterface::getParameters
SearchPluginBase::getType public function Overrides SearchInterface::getType 2
SearchPluginBase::isSearchExecutable public function Overrides SearchInterface::isSearchExecutable 2
SearchPluginBase::searchFormAlter public function Overrides SearchInterface::searchFormAlter 1
SearchPluginBase::setSearch public function Overrides SearchInterface::setSearch 1
SearchPluginBase::suggestedTitle public function Overrides SearchInterface::suggestedTitle
SearchPluginBase::usesAdminTheme public function Overrides SearchInterface::usesAdminTheme
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
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.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.