public loadLocations ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\Content\Location $rootLocation = null ) : eZ\Publish\API\Repository\Values\Content\Location[] | ||
$contentInfo | eZ\Publish\API\Repository\Values\Content\ContentInfo | |
$rootLocation | eZ\Publish\API\Repository\Values\Content\Location | |
return | eZ\Publish\API\Repository\Values\Content\Location[] | An array of {@link Location} |
public function loadLocations(ContentInfo $contentInfo, APILocation $rootLocation = null)
{
if (!$contentInfo->published) {
throw new BadStateException('$contentInfo', 'ContentInfo has no published versions');
}
$spiLocations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($contentInfo->id, $rootLocation !== null ? $rootLocation->id : null);
$locations = array();
foreach ($spiLocations as $spiLocation) {
$locations[] = $this->domainMapper->buildLocationDomainObject($spiLocation);
}
return $locations;
}