eZ\Publish\Core\REST\Server\Controller\Location::loadLocationsForContent PHP Method

loadLocationsForContent() public method

Loads all locations for content object.
public loadLocationsForContent ( mixed $contentId, Request $request ) : LocationList
$contentId mixed
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\LocationList
    public function loadLocationsForContent($contentId, Request $request)
    {
        $restLocations = array();
        $contentInfo = $this->contentService->loadContentInfo($contentId);
        foreach ($this->locationService->loadLocations($contentInfo) as $location) {
            $restLocations[] = new Values\RestLocation($location, $this->locationService->getLocationChildCount($location));
        }
        return new Values\CachedValue(new Values\LocationList($restLocations, $request->getPathInfo()), array('locationId' => $contentInfo->mainLocationId));
    }