public function RestrictedNameProcessor::preIndexSave in Open Social 8.9
Same name and namespace in other branches
- 8.7 modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
- 8.8 modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
- 10.3.x modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
- 10.0.x modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
- 10.1.x modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
- 10.2.x modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php \Drupal\social_profile_privacy\Plugin\search_api\processor\RestrictedNameProcessor::preIndexSave()
Preprocesses the search index entity before it is saved.
This can, for example, be used to make sure fields needed by this processor are enabled on the index.
Overrides ProcessorPluginBase::preIndexSave
File
- modules/
social_features/ social_profile/ modules/ social_profile_privacy/ src/ Plugin/ search_api/ processor/ RestrictedNameProcessor.php, line 73
Class
- RestrictedNameProcessor
- The RestrictedNameProcessor adds the restricted name to search indexes.
Namespace
Drupal\social_profile_privacy\Plugin\search_api\processorCode
public function preIndexSave() {
$datasources = $this
->getIndex()
->getDatasources();
// Ensure that we have our "Restricted Name" field for all our supported
// datasources.
foreach ($datasources as $datasource_id => $datasource) {
if ($this
->supportsDataSource($datasource)) {
$this
->ensureField($datasource_id, 'social_profile_privacy_restricted_name');
}
}
}