public function BlockedUsers::preprocessSearchQuery in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.2 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.3 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.4 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.5 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.6 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.7 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 8.8 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 10.3.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 10.0.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 10.1.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
- 10.2.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::preprocessSearchQuery()
Preprocesses a search query.
Parameters
\Drupal\search_api\Query\QueryInterface $query: The object representing the query to be executed.
Overrides ProcessorPluginBase::preprocessSearchQuery
File
- modules/
social_features/ social_search/ src/ Plugin/ search_api/ processor/ BlockedUsers.php, line 65
Class
- BlockedUsers
- Ignores blocked users in index and queries.
Namespace
Drupal\social_search\Plugin\search_api\processorCode
public function preprocessSearchQuery(QueryInterface $query) {
if (!$query
->getOption('search_api_bypass_access')) {
// Add a condition to filter out users through the status field.
$conditions = $query
->createConditionGroup('AND');
$conditions
->addCondition('user_status', 0, '<>');
// Add the conditions.
$query
->addConditionGroup($conditions);
}
}