You are here

public function Lingotek::getCommunities in Lingotek Translation 8.2

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

Overrides LingotekInterface::getCommunities

1 call to Lingotek::getCommunities()
Lingotek::getResources in src/Lingotek.php

File

src/Lingotek.php, line 122

Class

Lingotek
The connecting class between Drupal and Lingotek

Namespace

Drupal\lingotek

Code

public function getCommunities($force = FALSE) {
  $resources_key = 'account.resources.community';
  $data = $this->configFactory
    ->get(static::SETTINGS)
    ->get($resources_key);
  if (empty($data) || $force) {
    $data = $this->api
      ->getCommunities($force);
    $this->configFactory
      ->getEditable(static::SETTINGS)
      ->set($resources_key, $data)
      ->save();
  }
  return $data;
}