Skip to content

Instantly share code, notes, and snippets.

@jpingo
Created March 4, 2013 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpingo/bf69d704c162677c5fc1 to your computer and use it in GitHub Desktop.
Save jpingo/bf69d704c162677c5fc1 to your computer and use it in GitHub Desktop.
Public API language issue EZP-20527
<?php
function _testCreateFolderObject()
{
$contentService = $this->repo->getContentService();
$locationService = $this->repo->getLocationService();
$contentTypeService = $this->repo->getContentTypeService();
$contentType = $contentTypeService->loadContentTypeByIdentifier( 'folder' );
$contentCreateStruct = $contentService->newContentCreateStruct( $contentType, 'eng-GB' );
$contentCreateStruct->setField ( 'name', 'Media Object' );
$locationCreateStruct = $locationService->newLocationCreateStruct( 2 );
$draft = $contentService->createContent( $contentCreateStruct, array( $locationCreateStruct ) );
$contentService->publishVersion( $draft->versionInfo );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment