class SearchQueryAlterHooks

Hook implementations for search_query_alter.

Hierarchy

Expanded class hierarchy of SearchQueryAlterHooks

File

core/modules/search/tests/modules/search_query_alter/src/Hook/SearchQueryAlterHooks.php, line 13

Namespace

Drupal\search_query_alter\Hook
View source
class SearchQueryAlterHooks {
    
    /**
     * Implements hook_query_TAG_alter().
     *
     * Tags search_$type with $type node_search.
     */
    public function querySearchNodeSearchAlter(AlterableInterface $query) {
        // For testing purposes, restrict the query to node type 'article' only.
        $query->condition('n.type', 'article');
    }

}

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