Skip to content

Instantly share code, notes, and snippets.

@MarcosLoureiro
Created June 28, 2013 13:11
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 MarcosLoureiro/fcb217f5a1dfa31684f1 to your computer and use it in GitHub Desktop.
Save MarcosLoureiro/fcb217f5a1dfa31684f1 to your computer and use it in GitHub Desktop.
Script used for the issue EZP-21149
function testEzp21149()
{
$contentTypeService = $this->repo->getContentTypeService();
$newClass = $contentTypeService->newContentTypeCreateStruct( 'single_user' );
$newClass->mainLanguageCode = "eng-GB";
// $newClass->names = array( "eng-GB" => "Single User" );
$defUserOne = $contentTypeService->newFieldDefinitionCreateStruct( 'user_one' , "ezuser" );
$defUserOne->names = array( "eng-GB" => "User One" );
$defUserOne->position = 1;
$newClass->addFieldDefinition( $defUserOne );
$newClass->addFieldDefinition( $defUserTwo );
$contentTypeService->createContentType(
$newClass,
array( $contentTypeService->loadContentTypeGroupByIdentifier( 'Content' ) )
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment