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

hideLocation() public method

Hides the $location and marks invisible all descendants of $location.
public hideLocation ( 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 hideLocation(APILocation $location)
    {
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
            throw new UnauthorizedException('content', 'hide');
        }
        $this->repository->beginTransaction();
        try {
            $this->persistenceHandler->locationHandler()->hide($location->id);
            $this->repository->commit();
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
        return $this->loadLocation($location->id);
    }