You are here

public function SmartlingConfigManager::getConfigByProjectId in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 src/Smartling/ConfigManager/SmartlingConfigManager.php \Drupal\tmgmt_smartling\Smartling\ConfigManager\SmartlingConfigManager::getConfigByProjectId()

Returns smartling provider config by project id.

Parameters

$projectId:

Return value

Config|NULL

File

src/Smartling/ConfigManager/SmartlingConfigManager.php, line 58
FirebaseConfigManager.

Class

SmartlingConfigManager
Class SmartlingConfigManager.

Namespace

Drupal\tmgmt_smartling\Smartling\ConfigManager

Code

public function getConfigByProjectId($projectId) {
  $configs = $this
    ->getAvailableConfigs();
  $result = NULL;
  foreach ($configs as $config) {
    $provider_settings = $config
      ->get('settings');
    if (!empty($provider_settings["project_id"]) && $provider_settings["project_id"] == $projectId) {
      $result = $config;
      break;
    }
  }
  return $result;
}