class NodeSearch
Same name and namespace in other branches
- 11.x core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 10 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 9 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 8.9.x core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
Handles searching for node entities using the Search module index.
Attributes
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\search\Plugin\ConfigurableSearchPluginBase implements \Drupal\search\Plugin\ConfigurableSearchPluginInterface uses \Drupal\Core\Plugin\ConfigurableTrait extends \Drupal\search\Plugin\SearchPluginBase
- class \Drupal\node\Plugin\Search\NodeSearch implements \Drupal\Core\Access\AccessibleInterface extends \Drupal\search\Plugin\ConfigurableSearchPluginBase
- class \Drupal\search\Plugin\ConfigurableSearchPluginBase implements \Drupal\search\Plugin\ConfigurableSearchPluginInterface uses \Drupal\Core\Plugin\ConfigurableTrait extends \Drupal\search\Plugin\SearchPluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of NodeSearch
Deprecated
in drupal:11.4.0 and is removed from drupal:12.0.0. Instead, use \Drupal\search_node\Plugin\Search\SearchNode.
See also
https://www.drupal.org/node/3590298
File
-
core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php, line 30
Namespace
Drupal\node\Plugin\SearchView source
class NodeSearch extends ConfigurableSearchPluginBase implements AccessibleInterface {
/**
* The messenger.
*
* @var \Drupal\Core\Messenger\MessengerInterface
*/
protected $messenger;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('database'), $container->get('entity_type.manager'), $container->get('module_handler'), $container->get('config.factory')
->get('search.settings'), $container->get('language_manager'), $container->get('renderer'), $container->get('messenger'), $container->get('current_user'), $container->get('database.replica'), $container->get('search.index'), $container->get('entity_type.bundle.info'));
}
/**
* Constructs a \Drupal\node\Plugin\Search\NodeSearch object.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, protected Connection $database, protected EntityTypeManagerInterface $entityTypeManager, protected ModuleHandlerInterface $moduleHandler, protected Config $searchSettings, protected LanguageManagerInterface $languageManager, protected RendererInterface $renderer, MessengerInterface $messenger, protected AccountInterface $account, protected Connection $databaseReplica, protected SearchIndexInterface $searchIndex, protected EntityTypeBundleInfoInterface $entityTypeBundleInfo) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Instead, use \\Drupal\\search_node\\Plugin\\Search\\SearchNode. See https://www.drupal.org/node/3590298', E_USER_DEPRECATED);
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->setMessenger($messenger);
$this->addCacheTags([
'node_list',
]);
}
/**
* {@inheritdoc}
*/
public function access($operation = 'view', ?AccountInterface $account = NULL, $return_as_object = FALSE) {
return AccessResult::forbidden();
}
/**
* {@inheritdoc}
*/
public function isSearchExecutable() {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function execute() {
return [];
}
/**
* {@inheritdoc}
*/
public function updateIndex() {
}
/**
* {@inheritdoc}
*/
public function indexClear() {
}
/**
* {@inheritdoc}
*/
public function markForReindex() {
}
/**
* {@inheritdoc}
*/
public function indexStatus() {
return [];
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.