public static function BlockedUsers::supportsIndex 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::supportsIndex()
- 8.2 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.3 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.4 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.5 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.6 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.7 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 8.8 modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 10.3.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 10.0.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 10.1.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
- 10.2.x modules/social_features/social_search/src/Plugin/search_api/processor/BlockedUsers.php \Drupal\social_search\Plugin\search_api\processor\BlockedUsers::supportsIndex()
Checks whether this processor is applicable for a certain index.
This can be used for hiding the processor on the index's "Filters" tab. To avoid confusion, you should only use criteria that are more or less constant, such as the index's datasources. Also, since this is only used for UI purposes, you should not completely rely on this to ensure certain index configurations and at least throw an exception with a descriptive error message if this is violated on runtime.
Parameters
\Drupal\search_api\IndexInterface $index: The index to check for.
Return value
bool TRUE if the processor can run on the given index; FALSE otherwise.
Overrides ProcessorPluginBase::supportsIndex
File
- modules/
social_features/ social_search/ src/ Plugin/ search_api/ processor/ BlockedUsers.php, line 32
Class
- BlockedUsers
- Ignores blocked users in index and queries.
Namespace
Drupal\social_search\Plugin\search_api\processorCode
public static function supportsIndex(IndexInterface $index) {
$entity_types = [
'profile',
];
foreach ($index
->getDatasources() as $datasource) {
if (in_array($datasource
->getEntityTypeId(), $entity_types)) {
return TRUE;
}
}
return FALSE;
}