RestrictedNameProcessorOverride.php in Open Social 8.8
Same filename and directory in other branches
- 8.9 modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
- 8.7 modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
- 10.3.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
- 10.0.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
- 10.1.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
- 10.2.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php
Namespace
Drupal\social_profile_privacyFile
modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.phpView source
<?php
namespace Drupal\social_profile_privacy;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
/**
* Adds the Restricted Name field to our required processors.
*
* @package Drupal\social_profile_privacy
*/
class RestrictedNameProcessorOverride implements ConfigFactoryOverrideInterface {
/**
* Load overrides.
*/
public function loadOverrides($names) {
$overrides = [];
// Set hero title block for book content type.
$config_names = [
'search_api.index.social_all',
'search_api.index.social_users',
];
foreach ($config_names as $config_name) {
if (in_array($config_name, $names, TRUE)) {
$overrides[$config_name] = [
'processor_settings' => [
'tokenizer' => [
'fields' => [
'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
],
],
'ignorecase' => [
'fields' => [
'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
],
],
'transliteration' => [
'fields' => [
'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
],
],
],
];
}
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialProfileProviacy';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name | Description |
---|---|
RestrictedNameProcessorOverride | Adds the Restricted Name field to our required processors. |