public function SuperUser::alterIndexedItems in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.2 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.3 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.4 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.5 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.6 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.7 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 8.8 modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 10.3.x modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 10.0.x modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 10.1.x modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
- 10.2.x modules/social_features/social_search/src/Plugin/search_api/processor/SuperUser.php \Drupal\social_search\Plugin\search_api\processor\SuperUser::alterIndexedItems()
Alter the items to be indexed.
Parameters
\Drupal\search_api\Item\ItemInterface[] $items: An array of items to be indexed, passed by reference.
Overrides ProcessorPluginBase::alterIndexedItems
File
- modules/
social_features/ social_search/ src/ Plugin/ search_api/ processor/ SuperUser.php, line 40
Class
- SuperUser
- Adds access checks for profiles.
Namespace
Drupal\social_search\Plugin\search_api\processorCode
public function alterIndexedItems(array &$items) {
foreach ($items as $item_id => $item) {
$object = $item
->getOriginalObject()
->getValue();
if ($object instanceof ProfileInterface) {
// Profile ownedId is the userId.
if ($object
->getOwnerId() == '1') {
unset($items[$item_id]);
}
}
elseif ($object instanceof UserInterface) {
if ($object
->id() == '1') {
unset($items[$item_id]);
}
}
}
}