@param \eZ\Publish\API\Repository\Values\Content\Location $location

@return \EzSystems\EzPlatformAdminUi\UI\Dataset\CustomUrlsDataset
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;
    }
728460
public function getHandler( Location $location )
    {
        foreach ( $this->providers as $providersPriority )
        {
            foreach ( $providersPriority as $provider )
            {
                $currentHandler = $provider->getHandler( $location );

                if ( !$currentHandler instanceof NullHandler )
                {
                    return $currentHandler;
                }
            }
        }

        return new NullHandler();
    }
363543
protected function buildTrashItem(Location $location)
    {
        return new TrashItem(
            array(
                'contentInfo' => $location->contentInfo,
                'id' => $location->id,
                'priority' => $location->priority,
                'hidden' => $location->hidden,
                'invisible' => $location->invisible,
                'remoteId' => $location->remoteId,
                'parentLocationId' => $location->parentLocationId,
                'pathString' => $location->pathString,
                'depth' => (int)$location->depth,
                'sortField' => $location->sortField,
                'sortOrder' => $location->sortOrder,
            )
        );
    }
1333145
public function addSiteMap($location, $lastModification = null)
    {
        $sitemapElement = $this->createElement('sitemap');

        if (0 === strpos($location, '/')) {
            $location = $this->baseUri.$location;
        }
        $locElement = $this->createElement('loc');
        $locElement->appendChild($this->createTextNode($location));
        $sitemapElement->appendChild($locElement);

        if (null !== $lastModification) {
            if ($lastModification instanceof \DateTime) {
                $lastModification = $lastModification->format('c');
            } else {
                if (is_string($lastModification)) {
                    $lastModification = strtotime($lastModification);
                }
                $lastModification = date('c', $lastModification);
            }

            $lastmodElement = $this->createElement('lastmod');
            $lastmodElement->appendChild($this->createTextNode($lastModification));
            $sitemapElement->appendChild($lastmodElement);
        }

        $this->root->appendChild($sitemapElement);

        return $this;
    }
516985
public function matchLocation(Location $location)
    {
        $section = $this->repository->sudo(
            function (Repository $repository) use ($location) {
                return $repository->getSectionService()->loadSection(
                    $location->getContentInfo()->sectionId
                );
            }
        );

        return isset($this->values[$section->identifier]);
    }
279746
public function listPlaceListAction(Location $location)
    {
        /** @var \EzSystems\DemoBundle\Helper\PlaceHelper $placeHelper */
        $placeHelper = $this->get('ezdemo.place_helper');

        $places = $placeHelper->getPlaceList(
            $location,
            $this->container->getParameter('ezdemo.places.place_list.content_types'),
            $this->getConfigResolver()->getParameter('languages')
        );

        return $this->render(
            'eZDemoBundle:parts/place:place_list.html.twig',
            array('places' => $places)
        );
    }
323614
public function getCellFeed($location)
    {
        if ($location instanceof Zend_Gdata_Spreadsheets_CellQuery) {
            $uri = $location->getQueryUrl();
        } else if ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
            $uri = $location->getLink(self::CELL_FEED_LINK_URI)->href;
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_Spreadsheets_CellFeed');
    }
1016167
public function getCalendarEventFeed($location = null)
    {
        if ($location == null) {
            $uri = self::CALENDAR_EVENT_FEED_URI;
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_Calendar_EventFeed');
    }
1231755
public static function to($location, $data = null)
    {
        $location = ($location === '/') ? URL : URL . $location;

        $c = ($data) ? '?twigformfields='.base64_encode(json_encode($data)) : null;
        header('Location: ' . $location . $c);
        exit;
    }
67788
public static function getMetadataByLocation( ezpContentLocation $location )
    {
        $url = $location->url_alias;
        eZURI::transformURI( $url, false, 'full' ); // $url is passed as a reference

        $aMetadata = array(
            'nodeId'        => (int)$location->node_id,
            'nodeRemoteId'  => $location->remote_id,
            'fullUrl'       => $url
        );

        return $aMetadata;
    }
940737
private function filesIterator(string $location, string $pattern = null): \GlobIterator
    {
        $pattern = $pattern ?? '*';
        $regexp = rtrim($location, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($pattern, DIRECTORY_SEPARATOR);

        return new \GlobIterator($regexp);
    }
117258
private function createLocationAddForm(Location $location): FormInterface
    {
        return $this->formFactory->addLocation(
            new ContentLocationAddData($location->getContentInfo())
        );
    }
219519
public static function redirect($location, $permanent = false)
    {
        $redirect = new static($permanent ? 301 : 302);
        $redirect->setHeader('Location', $location);

        return $redirect;
    }
570935
private function loadLocation($locationId): Location
    {
        $location = $this->repository->sudo(
            function (Repository $repository) use ($locationId) {
                return $repository->getLocationService()->loadLocation($locationId);
            }
        );

        return $location;
    }
419540
private function getContentType(EzLocation $location): ContentType
    {
        if (method_exists($location, 'getContent') && method_exists($location->getContent(), 'getContentType')) {
            return $location->getContent()->getContentType();
        }

        // @deprecated Remove when support for eZ kernel < 7.4 ends

        return $this->repository->getContentTypeService()->loadContentType(
            $location->contentInfo->contentTypeId
        );
    }
1212837
public function doGenerate($location, array $parameters)
    {
        $urlAliasService = $this->repository->getURLAliasService();

        $siteaccess = null;
        if (isset($parameters['siteaccess'])) {
            $siteaccess = $parameters['siteaccess'];
            unset($parameters['siteaccess']);
        }

        if ($siteaccess) {
            // We generate for a different SiteAccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $siteaccess);
            $urlAliases = $urlAliasService->listLocationAliases($location, false, null, null, $languages);
            // Use the target SiteAccess root location
            $rootLocationId = $this->configResolver->getParameter('content.tree_root.location_id', null, $siteaccess);
        } else {
            $languages = null;
            $urlAliases = $urlAliasService->listLocationAliases($location, false);
            $rootLocationId = $this->rootLocationId;
        }

        $queryString = '';
        unset($parameters['language'], $parameters['contentId']);
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        if (!empty($urlAliases)) {
            $path = $urlAliases[0]->path;
            // Remove rootLocation's prefix if needed.
            if ($rootLocationId !== null) {
                $pathPrefix = $this->getPathPrefixByRootLocationId($rootLocationId, $languages, $siteaccess);
                // "/" cannot be considered as a path prefix since it's root, so we ignore it.
                if ($pathPrefix !== '/' && ($path === $pathPrefix || mb_stripos($path, $pathPrefix . '/') === 0)) {
                    $path = mb_substr($path, mb_strlen($pathPrefix));
                } elseif ($pathPrefix !== '/' && !$this->isUriPrefixExcluded($path) && $this->logger !== null) {
                    // Location path is outside configured content tree and doesn't have an excluded prefix.
                    // This is most likely an error (from content edition or link generation logic).
                    $this->logger->warning("Generating a link to a location outside root content tree: '$path' is outside tree starting to location #$rootLocationId");
                }
            }
        } else {
            $path = $this->defaultRouter->generate(
                self::INTERNAL_CONTENT_VIEW_ROUTE,
                array('contentId' => $location->contentId, 'locationId' => $location->id)
            );
        }

        $path = $path ?: '/';

        // replace potentially unsafe characters with url-encoded counterpart
        return strtr($path . $queryString, $this->unsafeCharMap);
    }
289230
protected function getForwardRequest(Location $location, Content $content, SiteAccess $previewSiteAccess, Request $request, $language)
    {
        $request = parent::getForwardRequest($location, $content, $previewSiteAccess, $request, $language);

        $overrideViewAction = $this->configResolver->getParameter(
            'override_url_alias_view_action',
            'netgen_ez_platform_site_api'
        );

        // If the preview siteaccess is configured in legacy_mode
        // we forward to the LegacyKernelController.
        // For compatibility with eZ Publish Legacy
        if ($this->isLegacyModeSiteAccess($previewSiteAccess->name)) {
            $request->attributes->set('_controller', 'ezpublish_legacy.controller:indexAction');
        } elseif ($overrideViewAction) {
            $request->attributes->set('_controller', UrlAliasRouter::OVERRIDE_VIEW_ACTION);

            $this->injectSiteApiValueObjects($request, $language);
        }

        return $request;
    }