public function StringBase::getLocations

Implements Drupal\locale\StringInterface::getLocation().

Overrides StringInterface::getLocations

1 call to StringBase::getLocations()
StringBase::hasLocation in drupal/core/modules/locale/lib/Drupal/locale/StringBase.php
Implements Drupal\locale\StringInterface::hasLocation().

File

drupal/core/modules/locale/lib/Drupal/locale/StringBase.php, line 157
Definition of Drupal\locale\StringBase.

Class

StringBase
Defines the locale string base class.

Namespace

Drupal\locale

Code

public function getLocations($check_only = FALSE) {
  if (!isset($this->locations) && !$check_only) {
    $this->locations = array();
    foreach ($this
      ->getStorage()
      ->getLocations(array(
      'sid' => $this
        ->getId(),
    )) as $location) {
      $this->locations[$location->type][$location->name] = $location->lid;
    }
  }
  return isset($this->locations) ? $this->locations : array();
}