You are here

public function ViewsNaturalSortService::getDefaultTransformations in Views Natural Sort 8.2

1 call to ViewsNaturalSortService::getDefaultTransformations()
ViewsNaturalSortService::getTransformations in src/ViewsNaturalSortService.php
Get the full list of transformations to run when saving an index record.

File

src/ViewsNaturalSortService.php, line 71

Class

ViewsNaturalSortService
Service that manages Views Natural Sort records.

Namespace

Drupal\views_natural_sort

Code

public function getDefaultTransformations() {
  $default_transformations = [
    'remove_beginning_words',
    'remove_words',
    'remove_symbols',
    'numbers',
    'days_of_the_week',
  ];
  $config = $this->configFactory
    ->get('views_natural_sort.settings');
  $transformations = [];
  foreach ($default_transformations as $plugin_id) {
    if ($config
      ->get('transformation_settings.' . $plugin_id . '.enabled')) {
      $transformations[] = $this->transformationManager
        ->createInstance($plugin_id, $config
        ->get('transformation_settings.' . $plugin_id));
    }
  }
  return $transformations;
}