public function createDraft($contentTypeIdentifier, array $fields)
{
$contentService = $this->repository->getContentService();
$createStruct = $contentService->newContentCreateStruct($this->repository->getContentTypeService()->loadContentTypeByIdentifier($contentTypeIdentifier), 'eng-GB');
foreach ($fields as $fieldDefIdentifier => $fieldValue) {
$createStruct->setField($fieldDefIdentifier, $fieldValue);
}
$locationCreateStruct = $this->repository->getLocationService()->newLocationCreateStruct(2);
$this->currentDraft = $this->repository->sudo(function () use($createStruct, $locationCreateStruct) {
return $this->repository->getContentService()->createContent($createStruct, [$locationCreateStruct]);
});
return $this->currentDraft;
}