You are here

public function RestrictedNameProcessor::getPropertyDefinitions in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 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::getPropertyDefinitions()
  2. 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::getPropertyDefinitions()
  3. 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::getPropertyDefinitions()
  4. 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::getPropertyDefinitions()
  5. 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::getPropertyDefinitions()
  6. 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::getPropertyDefinitions()

Retrieves the properties this processor defines for the given datasource.

Property names have to start with a letter or an underscore, followed by any number of letters, numbers and underscores. To avoid collisions, it is also recommended to prefix the property name with the identifier of the module defining the processor.

Parameters

\Drupal\search_api\Datasource\DatasourceInterface|null $datasource: (optional) The datasource this set of properties belongs to. If NULL, the datasource-independent properties should be added (or modified).

Return value

\Drupal\search_api\Processor\ProcessorPropertyInterface[] An array of property definitions for that datasource, keyed by property names.

Overrides ProcessorPluginBase::getPropertyDefinitions

File

modules/social_features/social_profile/modules/social_profile_privacy/src/Plugin/search_api/processor/RestrictedNameProcessor.php, line 53

Class

RestrictedNameProcessor
The RestrictedNameProcessor adds the restricted name to search indexes.

Namespace

Drupal\social_profile_privacy\Plugin\search_api\processor

Code

public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) {
  $properties = parent::getPropertyDefinitions($datasource);
  if ($datasource && $this
    ->supportsDataSource($datasource)) {
    $definition = [
      'label' => $this
        ->t('Restricted Name'),
      'description' => $this
        ->t('The display name that is visible for unpriviliged users.'),
      'type' => 'search_api_text',
      'is_list' => FALSE,
      'processor_id' => $this
        ->getPluginId(),
    ];
    $properties['social_profile_privacy_restricted_name'] = new ProcessorProperty($definition);
  }
  return $properties;
}