public static function RoleFilter::supportsIndex in Search API 8
Can only be enabled for an index that indexes the user entity.
Overrides ProcessorPluginBase::supportsIndex
File
- src/
Plugin/ search_api/ processor/ RoleFilter.php, line 35
Class
- RoleFilter
- Filters out users based on their role.
Namespace
Drupal\search_api\Plugin\search_api\processorCode
public static function supportsIndex(IndexInterface $index) {
foreach ($index
->getDatasources() as $datasource) {
if ($datasource
->getEntityTypeId() == 'user') {
return TRUE;
}
}
return FALSE;
}