protected function addNewMainLocation($contentInfo, $parentLocationId) { $locationService = $this->repository->getLocationService(); $contentService = $this->repository->getContentService(); $newLocation = $locationService->createLocation($contentInfo, new LocationCreateStruct(array('remoteId' => md5(uniqid(get_class($this), true)), 'parentLocationId' => $parentLocationId))); $contentService->updateContentMetadata($contentInfo, new ContentMetadataUpdateStruct(array('mainLocationId' => $newLocation->id))); return $newLocation->id; }