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;
}