eZ\Publish\Core\Repository\LocationService::unhideLocation PHP Method

unhideLocation() public method

This method and marks visible all descendants of $locations until a hidden location is found.
public unhideLocation ( eZ\Publish\API\Repository\Values\Content\Location $location ) : eZ\Publish\API\Repository\Values\Content\Location
$location eZ\Publish\API\Repository\Values\Content\Location
return eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
    public function unhideLocation(APILocation $location)
    {
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
            throw new UnauthorizedException('content', 'hide');
        }
        $this->repository->beginTransaction();
        try {
            $this->persistenceHandler->locationHandler()->unHide($location->id);
            $this->repository->commit();
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
        return $this->loadLocation($location->id);
    }