Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StringBase.php

function StringBase::getLocations

Overrides StringInterface::getLocations

1 call to StringBase::getLocations()
StringBase::hasLocation in core/modules/locale/src/StringBase.php
Checks whether the string has a given location.

File

core/modules/locale/src/StringBase.php, line 154

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 = [];
        foreach ($this->getStorage()
            ->getLocations([
            'sid' => $this->getId(),
        ]) as $location) {
            $this->locations[$location->type][$location->name] = $location->lid;
        }
    }
    return $this->locations ?? [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal