class ConfigurableSearchPluginBase

Same name in other branches
  1. 9 core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php \Drupal\search\Plugin\ConfigurableSearchPluginBase
  2. 8.9.x core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php \Drupal\search\Plugin\ConfigurableSearchPluginBase
  3. 10 core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php \Drupal\search\Plugin\ConfigurableSearchPluginBase

Provides a base implementation for a configurable Search plugin.

Hierarchy

  • class \Drupal\search\Plugin\ConfigurableSearchPluginBase extends \Drupal\search\Plugin\SearchPluginBase implements \Drupal\search\Plugin\ConfigurableSearchPluginInterface

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 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 31
PluginFormInterface::submitConfigurationForm public function Form submission handler. 29
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2
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

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