You are here

protected function LingotekFilterManager::chooseAppropriateFilterID in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  2. 4.0.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  3. 3.0.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  4. 3.1.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  5. 3.2.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  6. 3.3.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  7. 3.4.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  8. 3.6.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  9. 3.7.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()
  10. 3.8.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::chooseAppropriateFilterID()

Helper used to choose the appropriate filter ID based on the one listed in settings.

Parameters

string $settingsFilter: Either 'project_default', 'drupal_default' or the filter ID.

string $drupalDefaultFilterID: The Drupal default filter ID.

Return value

string|null The appropriate filter ID or NULL if project default is to be used.

2 calls to LingotekFilterManager::chooseAppropriateFilterID()
LingotekFilterManager::getFilterId in src/LingotekFilterManager.php
Gets the filter that should be applied.
LingotekFilterManager::getSubfilterId in src/LingotekFilterManager.php
Gets the subfilter that should be applied.

File

src/LingotekFilterManager.php, line 168

Class

LingotekFilterManager
Service for managing Lingotek Filters.

Namespace

Drupal\lingotek

Code

protected function chooseAppropriateFilterID($settingsFilter, $drupalDefaultFilterID) {
  $filter = $settingsFilter;
  switch ($settingsFilter) {
    case 'project_default':
      $filter = NULL;
      break;
    case 'drupal_default':
      $filter = $drupalDefaultFilterID;
      break;
  }
  return $filter;
}