public function PhotosImageSearch::__construct in Album Photos 8.5
Same name and namespace in other branches
- 6.0.x src/Plugin/Search/PhotosImageSearch.php \Drupal\photos\Plugin\Search\PhotosImageSearch::__construct()
Constructs a \Drupal\photos\Plugin\Search\PhotosImageSearch object.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Database\Connection $database: The current database connection.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: A module manager object.
\Drupal\Core\Config\Config $search_settings: A config object for 'search.settings'.
\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.
\Drupal\Core\Render\RendererInterface $renderer: The renderer.
\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.
\Drupal\Core\Session\AccountInterface $account: The $account object to use for checking for access to advanced search.
\Drupal\Core\Database\Connection|null $database_replica: (Optional) the replica database connection.
\Drupal\search\SearchIndexInterface $search_index: The search index.
Overrides ConfigurableSearchPluginBase::__construct
File
- src/
Plugin/ Search/ PhotosImageSearch.php, line 198
Class
- PhotosImageSearch
- Handles searching for photos_image entities using the Search module index.
Namespace
Drupal\photos\Plugin\SearchCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, Config $search_settings, LanguageManagerInterface $language_manager, RendererInterface $renderer, MessengerInterface $messenger, AccountInterface $account = NULL, Connection $database_replica = NULL, SearchIndexInterface $search_index = NULL) {
$this->database = $database;
$this->databaseReplica = $database_replica ?: $database;
$this->entityTypeManager = $entity_type_manager;
$this->moduleHandler = $module_handler;
$this->searchSettings = $search_settings;
$this->languageManager = $language_manager;
$this->renderer = $renderer;
$this->messenger = $messenger;
$this->account = $account;
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->addCacheTags([
'photos_image_list',
]);
$this->searchIndex = $search_index;
}