You are here

public function LingotekFilterManager::getDefaultFilter in Lingotek Translation 3.3.x

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

Get the default filter ID.

Return value

string ID of the default filter.

Overrides LingotekFilterManagerInterface::getDefaultFilter

2 calls to LingotekFilterManager::getDefaultFilter()
LingotekFilterManager::getDefaultFilterLabel in src/LingotekFilterManager.php
Get the default filter label.
LingotekFilterManager::getFilterId in src/LingotekFilterManager.php
Gets the filter that should be applied.

File

src/LingotekFilterManager.php, line 44

Class

LingotekFilterManager
Service for managing Lingotek Filters.

Namespace

Drupal\lingotek

Code

public function getDefaultFilter() {
  $filter = $this->configFactory
    ->get('lingotek.settings')
    ->get('default.filter');
  $filters = $this
    ->getLocallyAvailableFilters();
  if (!isset($filters[$filter])) {
    $filter = NULL;
  }
  return $filter;
}