function SearchIndex::__construct

Same name in other branches
  1. 8.9.x core/modules/search/src/SearchIndex.php \Drupal\search\SearchIndex::__construct()
  2. 10 core/modules/search/src/SearchIndex.php \Drupal\search\SearchIndex::__construct()
  3. 11.x core/modules/search/src/SearchIndex.php \Drupal\search\SearchIndex::__construct()

SearchIndex constructor.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Database\Connection $connection: The database connection.

\Drupal\Core\Database\Connection $replica: The database replica connection.

\Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator: The cache tags invalidator.

\Drupal\search\SearchTextProcessorInterface $text_processor: The text processor.

File

core/modules/search/src/SearchIndex.php, line 64

Class

SearchIndex
Provides search index management functions.

Namespace

Drupal\search

Code

public function __construct(ConfigFactoryInterface $config_factory, Connection $connection, Connection $replica, CacheTagsInvalidatorInterface $cache_tags_invalidator, SearchTextProcessorInterface $text_processor = NULL) {
    $this->configFactory = $config_factory;
    $this->connection = $connection;
    $this->replica = $replica;
    $this->cacheTagsInvalidator = $cache_tags_invalidator;
    if ($text_processor === NULL) {
        @trigger_error('Calling ' . __METHOD__ . ' without $text_processor argument is deprecated in drupal:9.1.0 and will be required in drupal:10.0.0. See https://www.drupal.org/node/3078162', E_USER_DEPRECATED);
        $text_processor = \Drupal::service('search.text_processor');
    }
    $this->textProcessor = $text_processor;
}

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