protected createTestContentLocation ( integer $parentLocationId ) : eZ\Publish\API\Repository\Values\Content\Content | ||
$parentLocationId | integer | |
Результат | eZ\Publish\API\Repository\Values\Content\Content |
protected function createTestContentLocation($parentLocationId)
{
$contentService = $this->repository->getContentService();
$contentTypeService = $this->repository->getContentTypeService();
// User Group content type
$contentType = $contentTypeService->loadContentType(3);
$contentCreate = $contentService->newContentCreateStruct($contentType, 'eng-GB');
$contentCreate->setField('name', 'dummy value');
$contentCreate->sectionId = 1;
$contentCreate->ownerId = 14;
$contentCreate->remoteId = md5(uniqid(get_class($this), true));
$contentCreate->alwaysAvailable = true;
$locationCreates = array(new LocationCreateStruct(array('remoteId' => md5(uniqid(get_class($this), true)), 'parentLocationId' => $parentLocationId)));
return $contentService->publishVersion($contentService->createContent($contentCreate, $locationCreates)->versionInfo);
}