eZ\Publish\Core\Repository\Tests\Service\Integration\LocationBase::addNewMainLocation PHP Method

addNewMainLocation() protected method

protected addNewMainLocation ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, integer $parentLocationId ) : mixed
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$parentLocationId integer
return mixed
    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;
    }