lib/Collection/QueryType/Handler/Traits/ParentLocationTrait.php
private function getParentLocation(ParameterCollectionInterface $parameterCollection): ?Location
    {
        if ($parameterCollection->getParameter('use_current_location')->getValue() === true) {
            return $this->contentProvider->provideLocation();
        }

        $parentLocationId = $parameterCollection->getParameter('parent_location_id')->getValue();
        if ($parentLocationId === null) {
            return null;
        }

        try {
            $parentLocation = $this->locationService->loadLocation($parentLocationId);

            return $parentLocation->invisible ? null : $parentLocation;
        } catch (Throwable $t) {
            return null;
        }
    }
private function getParentLocation(ParameterCollectionInterface $parameterCollection): ?Location
    {
        if ($parameterCollection->getParameter('use_current_location')->getValue() === true) {
            return $this->contentProvider->provideLocation();
        }

        $parentLocationId = $parameterCollection->getParameter('parent_location_id')->getValue();
        if ($parentLocationId === null) {
            return null;
        }

        try {
            $parentLocation = $this->locationService->loadLocation($parentLocationId);

            return $parentLocation->invisible ? null : $parentLocation;
        } catch (Throwable $t) {
            return null;
        }
    }
private function getParentLocation ( ParameterCollectionInterface $ parameterCollection ) : ? Location { if ( $ parameterCollection -> getParameter ( 'use_current_location' ) -> getValue ( ) === true ) { return $ this -> contentProvider -> provideLocation ( ) ; } $ parentLocationId = $ parameterCollection -> getParameter ( 'parent_location_id' ) -> getValue ( ) ; if ( $ parentLocationId === null ) { return null ; } try { $ parentLocation = $ this -> locationService -> loadLocation ( $ parentLocationId ) ; return $ parentLocation -> invisible ? null : $ parentLocation ; } catch ( Throwable $ t ) { return null ; } }
Returns the parent location to use for the parameter collection.
Returns the parent location to use for the parameter collection .