Returns the location path.

@param int|string $locationId

@return string[]
185311
public function getLocationPath($locationId): array
    {
        try {
            $location = $this->loadLocation($locationId);

            $locationPath = $location->path;
            array_shift($locationPath);

            $translatedNames = [];

            foreach ($locationPath as $locationPathId) {
                $locationInPath = $this->loadLocation($locationPathId);
                $translatedNames[] = $this->getContentName($locationInPath->contentInfo->id);
            }

            return $translatedNames;
        } catch (Throwable $t) {
            return [];
        }
    }
995249
private function getPath($resourceId = null)
    {
        if (!is_null($resourceId)) {
            $endpoint = ($this->isOrder($resourceId) ? Orders::PATH : Payment::PATH);

            return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, $endpoint, $resourceId, self::PATH);
        }

        if ($this->order !== null) {
            return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, Orders::PATH, $this->order->getId(), self::PATH);
        }

        return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, Payment::PATH, $this->payment->getId(), self::PATH);
    }
556418
protected function findLocationsByContentIds(array $contentIds)
    {
        $locations = [];

        foreach ($contentIds as $contentId) {
            $content = $this->repository->getContentService()->loadContent($contentId);
            foreach($this->repository->getLocationService()->loadLocations($content->contentInfo) as $location) {
                $locations[$location->id] = $location;
            }
        }

        return $locations;
    }
50514
public function getTaxonPath($taxonId): ?array
    {
        $taxon = $this->taxonRepository->find($taxonId);
        if (!$taxon instanceof TaxonInterface) {
            return null;
        }

        $parts = [$taxon->getName()];
        while ($taxon->getParent() instanceof TaxonInterface) {
            $taxon = $taxon->getParent();

            $parts[] = $taxon->getName();
        }

        return array_reverse($parts);
    }
1147327
public function getLocationName($locationId): ?string
    {
        try {
            $location = $this->loadService->loadLocation($locationId);
        } catch (UnauthorizedException | NotFoundException | TranslationNotMatchedException $e) {
            return null;
        }

        return $location->content->name;
    }
147697
public function getChildren($locationId)
    {
        try {
            return $this->innerGateway->getChildren($locationId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1329870
protected function getLocationPathString($contentId)
    {
        $content = $this->contentService->loadContent($contentId);
        $location = $this->locationService->loadLocation($content->contentInfo->mainLocationId);

        return $location->pathString;
    }
525079
public function getPluginPath($id)
    {
        $classId = $this->getIdentifier($id);
        if (!isset($this->pathMap[$classId])) {
            return null;
        }

        return File::normalizePath($this->pathMap[$classId]);
    }
33045
protected function getAncestorLocationsContentIds($contentId)
    {
        $locations = $this->locationHandler->loadLocationsByContent($contentId);
        $ancestorLocationContentIds = array();
        $ancestorLocationIds = array();

        foreach ($locations as $location) {
            $locationIds = explode('/', trim($location->pathString, '/'));
            // Remove Location of Content with $contentId
            array_pop($locationIds);
            // Remove Root Location id (id==1 in legacy DB)
            array_shift($locationIds);

            $ancestorLocationIds = array_merge($ancestorLocationIds, $locationIds);
        }

        foreach (array_unique($ancestorLocationIds) as $locationId) {
            $location = $this->locationHandler->load($locationId);

            $ancestorLocationContentIds[$location->contentId] = true;
        }

        return array_keys($ancestorLocationContentIds);
    }
790034
private function keyPath($cacheId)
    {
        $cacheId = $this->normalizeKey($cacheId);

        return FileUtils::join(array($this->root, $this->spread($cacheId)));
    }
313381
private function loadLocationEntriesMatchingMultipleLanguages($locationId, array $languageIds)
    {
        // note: alwaysAvailable for this use case is not relevant
        $languageMask = $this->languageMaskGenerator->generateLanguageMaskFromLanguageIds(
            $languageIds,
            false
        );

        $connection = $this->dbHandler->getConnection();
        /** @var \Doctrine\DBAL\Connection $connection */
        $query = $connection->createQueryBuilder();
        $query
            ->select('id', 'lang_mask', 'parent', 'text_md5')
            ->from($this->table)
            ->where('action = :action')
            // fetch rows matching any of the given Languages
            ->andWhere('lang_mask & :languageMask <> 0')
            ->setParameter(':action', 'eznode:' . $locationId)
            ->setParameter(':languageMask', $languageMask)
        ;

        $statement = $query->execute();
        $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);

        return $rows ?: [];
    }
684701
public function index($locationId)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $location = Location::findOrFail($locationId);
        $this->authorize('view', $location);
        return $this->respondRelatedPhones($locationId, 'location');
    }
1336279
protected function getDbRoutes($siteId = null): array
    {
        if ($siteId === null) {
            $siteId = Craft::$app->getSites()->currentSite->id;
        }
        if ($siteId === 'global') {
            $siteId = null;
        }
        // If we're on Craft 3.1 or later, just return the array from getProjectConfigRoutes();
        if (RouteMap::$craft31) {
            return Craft::$app->getRoutes()->getProjectConfigRoutes();
        }

        // Normalize the URL
        $results = (new Query())
            ->select(['uriPattern', 'template'])
            ->from(['{{%routes}}'])
            ->where([
                'or',
                ['siteId' => $siteId],
            ])
            ->orderBy(['sortOrder' => SORT_ASC])
            ->all();

        return ArrayHelper::map($results, 'uriPattern', function ($results) {
            return ['template' => $results['template']];
        });
    }
1278448
public function trashLocation($locationId)
    {
        $locationRow = $this->getBasicNodeData($locationId);

        /** @var $query \eZ\Publish\Core\Persistence\Database\InsertQuery */
        $query = $this->handler->createInsertQuery();
        $query->insertInto($this->handler->quoteTable('ezcontentobject_trash'));

        unset($locationRow['contentobject_is_published']);
        $locationRow['trashed'] = time();
        foreach ($locationRow as $key => $value) {
            $query->set($key, $query->bindValue($value));
        }

        $query->prepare()->execute();

        $this->removeLocation($locationRow['node_id']);
        $this->setContentStatus($locationRow['contentobject_id'], ContentInfo::STATUS_TRASHED);
    }
48988
public function getProgramsByLocation($location_id) {
    $cid = __METHOD__ . $location_id;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $data = $this->client->getPrograms(['branch' => $location_id]);

    $this->cache->set($cid, $data);
    return $data;
  }
1031826
public function getAncestryPaths($id)
    {
        list($start_vertex, $graph) = $this->getAncestryGraph($id);

        if (!$graph) {
            return [];
        }

        $resolver = new PathResolver($graph);

        return $resolver->resolvePaths($start_vertex);
    }
551457
public function getSchoolsByLocation($id) {
    $schools = [];

    $cid = __METHOD__ . $id;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $programs = $this->getChildCareProgramsByLocation($id);
    foreach ($programs as $program) {
      $schools_data = $this->getSchoolsByChildCareProgramId($program);
      foreach ($schools_data as $school) {
        $schools[$school['id']] = $school['name'];
      }
    }

    $this->cache->set($cid, $schools);
    return $schools;
  }