public function LingotekFilterManager::getFilterId in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 4.0.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.0.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.1.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.2.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.3.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.4.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.5.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.7.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
- 3.8.x src/LingotekFilterManager.php \Drupal\lingotek\LingotekFilterManager::getFilterId()
Gets the filter that should be applied.
Given filter provider can take precedence, or the settings default will be applied.
Parameters
\Drupal\lingotek\LingotekFilterProviderInterface|null $profile: A filter provider.
Return value
string The filter ID.
Overrides LingotekFilterManagerInterface::getFilterId
File
- src/
LingotekFilterManager.php, line 94
Class
- LingotekFilterManager
- Service for managing Lingotek Filters.
Namespace
Drupal\lingotekCode
public function getFilterId(LingotekFilterProviderInterface $profile = NULL) {
$defaults = new LingotekDefaultFilterProvider();
$defaultFilter = $defaults
->getFilter();
$filter = NULL;
$settingsFilter = $this
->getDefaultFilter();
if ($profile !== NULL && ($profileFilter = $profile
->getFilter())) {
switch ($profileFilter) {
case 'project_default':
$filter = NULL;
break;
case 'drupal_default':
$filter = $defaultFilter;
break;
case 'default':
$filter = $this
->chooseAppropriateFilterID($settingsFilter, $defaultFilter);
break;
default:
$filter = $profileFilter;
break;
}
}
else {
$filter = $this
->chooseAppropriateFilterID($settingsFilter, $defaultFilter);
}
return $filter;
}