Refresh all system URL aliases for the given Location (and historize outdated if needed).

@param \eZ\Publish\API\Repository\Values\Content\Location $location
978249
public function refreshSystemUrlAliasesForLocation(Location $location): void
    {
        $this->service->refreshSystemUrlAliasesForLocation($location);

        $this->signalDispatcher->emit(
            new UpdateLocationSignal(
                [
                    'contentId' => $location->contentId,
                    'locationId' => $location->id,
                    'parentLocationId' => $location->parentLocationId,
                ]
            )
        );
    }
1136331
public function indexLocation(Location $location)
    {
        $document = $this->mapper->mapLocation($location);

        $this->gateway->index($document);
    }
125226
private function createCustomUrlAddForm(Location $location): FormInterface
    {
        $customUrlAddData = new CustomUrlAddData($location);

        return $this->formFactory->addCustomUrl($customUrlAddData);
    }
105766
public function setStorageLocation(\Concrete\Core\Entity\File\StorageLocation\StorageLocation $location)
    {
        $this->storageLocation = $location;
    }
1222619
public function addLocation($location)
    {
        $this->setLocations(
            array_unique(
                array_merge(
                    $this->getLocations(),
                    [$location]
                )
            )
        );

        return $this;
    }
963961
public function load(Location $location): self
    {
        $customUrlAliases = $this->urlAliasService->listLocationAliases($location, true, null, true);
        $this->data = array_map(
            function (URLAlias $urlAlias) {
                return $this->valueFactory->createUrlAlias($urlAlias);
            },
            $customUrlAliases
        );

        return $this;
    }
1348775
private function loadFromLocation($location)
    {
        Logger::get()->debug('Loading settings...');
        // Add the trailing slash to the folder if it is missing.
        if (substr($location, -1) != DIRECTORY_SEPARATOR) {
            $location .= DIRECTORY_SEPARATOR;
        }
        $settingsLocation = $location . 'settings.json';

        if (!is_readable($settingsLocation)) {
            Logger::get()->error(
                'Settings file %s cannot be read.',
                $settingsLocation
            );
            throw new Settings\Exception("Settings file $settingsLocation is unavailable.");
        }

        // Load the settings.
        $settings = json_decode(file_get_contents($settingsLocation), true);
        if (empty($settings)) {
            throw new Settings\Exception('Settings file cannot be parsed.');
        }

        // Load settings customised for the current environment.
        $environmentSettings = null;
        $environment = self::getEnvironment();
        if ($environment) {
            $environmentSettingsLocation = sprintf(
                '%ssettings-%s.json',
                $location,
                strtolower($environment)
            );

            if (is_readable($environmentSettingsLocation)) {
                $environmentSettings = json_decode(file_get_contents($environmentSettingsLocation), true);
                if (!empty($environmentSettings)) {
                    $settings = self::mergeSettings($settings, $environmentSettings);
                }
            }
        }

        $this->settings = self::objectify($settings);

    }
154375
public function tagHttpCacheForLocation(Location $location)
    {
        $this->responseTagger->tag($location);
        $this->responseTagger->tag($location->getContentInfo());
    }
1189150
private function createRestLocation(Location $location): RestLocation
    {
        return new RestLocation(
            $location,
            $this->locationService->getLocationChildCount($location)
        );
    }
1336982
private function isMainLocation(Location $location)
    {
        $locationContentInfo = $this->contentHandler->loadContentInfo($location->contentId);

        return $locationContentInfo->mainLocationId === $location->id;
    }
1131616
public function mapLocation(Location $location)
    {
        $contentInfo = $this->contentHandler->loadContentInfo($location->contentId);
        $content = $this->contentHandler->load($location->contentId, $contentInfo->currentVersionNo);
        $section = $this->sectionHandler->load($content->versionInfo->contentInfo->sectionId);

        $document = $this->mapContentLocation($location, $content);
        $document->id = $location->id;
        $document->type = 'location';

        $document->fields[] = new Field(
            'is_main_location',
            ($location->id == $content->versionInfo->contentInfo->mainLocationId),
            new FieldType\BooleanField()
        );

        // UserGroups and Users are Content, but permissions cascade is achieved through
        // Locations hierarchy. We index all ancestor Location Content ids of all
        // Locations of an owner.
        $ancestorLocationsContentIds = $this->getAncestorLocationsContentIds($contentInfo->ownerId);
        // Add owner user id as it can also be considered as user group.
        $ancestorLocationsContentIds[] = $contentInfo->ownerId;
        $document->fields[] = new Field(
            'content_owner_user_group',
            $ancestorLocationsContentIds,
            new FieldType\MultipleIdentifierField()
        );

        $document->fields[] = new Field(
            'content_id',
            $content->versionInfo->contentInfo->id,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_type',
            $content->versionInfo->contentInfo->contentTypeId,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_version',
            $content->versionInfo->versionNo,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_status',
            $content->versionInfo->status,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_name',
            $content->versionInfo->contentInfo->name,
            new FieldType\StringField()
        );
        $document->fields[] = new Field(
            'content_creator',
            $content->versionInfo->creatorId,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_owner',
            $content->versionInfo->contentInfo->ownerId,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_section',
            $content->versionInfo->contentInfo->sectionId,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_section_identifier',
            $section->identifier,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_section_name',
            $section->name,
            new FieldType\StringField()
        );
        $document->fields[] = new Field(
            'content_remote_id',
            $content->versionInfo->contentInfo->remoteId,
            new FieldType\IdentifierField()
        );
        $document->fields[] = new Field(
            'content_modified',
            $content->versionInfo->contentInfo->modificationDate,
            new FieldType\DateField()
        );
        $document->fields[] = new Field(
            'content_published',
            $content->versionInfo->contentInfo->publicationDate,
            new FieldType\DateField()
        );
        $document->fields[] = new Field(
            'content_language_code',
            array_keys($content->versionInfo->names),
            new FieldType\MultipleStringField()
        );
        $document->fields[] = new Field(
            'content_always_available',
            $content->versionInfo->contentInfo->alwaysAvailable,
            new FieldType\BooleanField()
        );

        $contentType = $this->contentTypeHandler->load($content->versionInfo->contentInfo->contentTypeId);
        $document->fields[] = new Field(
            'content_group',
            $contentType->groupIds,
            new FieldType\MultipleIdentifierField()
        );

        $document->fields[] = new Field(
            'content_object_state',
            $this->getObjectStateIds($content->versionInfo->contentInfo->id),
            new FieldType\MultipleIdentifierField()
        );

        return $document;
    }
319263
public function matchLocation(Location $location)
    {
        $urlAliasService = $this->repository->getURLAliasService();
        $locationUrls = array_merge(
            $urlAliasService->listLocationAliases($location),
            $urlAliasService->listLocationAliases($location, false)
        );

        foreach ($this->values as $pattern => $val) {
            foreach ($locationUrls as $urlAlias) {
                if (strpos($urlAlias->path, "/$pattern") === 0) {
                    return true;
                }
            }
        }

        return false;
    }
76542
public function isRedirect($location = NULL) {

		return in_array(
				$this->statusCode,
				[
					self::HTTP_CREATED,
					self::HTTP_MOVED_PERMANENTLY,
					self::HTTP_FOUND,
					self::HTTP_SEE_OTHER,
					self::HTTP_TEMPORARY_REDIRECT,
					self::HTTP_PERMANENTLY_REDIRECT
				]
		) && (NULL === $location ?: $location == $this->headers->get('Location'));

	}
1213990
public function setLocation(string $location)
    {
        if (empty($location)) {
            Throw new HeaderException('Empty location is now allowed.');
        }

        $this->location = $location;
    }
236357
public function addAlias($location, $path) {
    $this->setVar('aliases', 
      $this->getVar('aliases').
      sprintf("\n  Alias %s %s", $location , $this->replaceHelpers($path))
    );
    return $this;
  }
609461
public function updateLocation(Location $location, $andFlush = true)
    {
        $this->objectManager->persist($location);
        if ($andFlush) {
            $this->objectManager->flush();
        }
    }
726054
public function setLocation(\BlackForest\PiwikBundle\Entity\PiwikLocation $location = null)
    {
        $this->location = $location;

        return $this;
    }