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) : void {
        // For testing purposes, restrict the query to node type 'article' only.
        $query->condition('n.type', 'article');
    }

}

Members

Title Sort descending Modifiers Object type Summary
SearchQueryAlterHooks::querySearchNodeSearchAlter public function Implements hook_query_TAG_alter().

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