eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentType PHP Method

createContentType() private method

Creates an instance of a contenttype and stores it for later publishing.
private createContentType ( )
    private function createContentType()
    {
        $name = $this->fieldConstructionObject['fieldType']->identifier;
        $name = $name . '#' . uniqid();
        $identifier = strtolower($name);
        $contentTypeCreateStruct = $this->contentTypeService->newContentTypeCreateStruct($identifier);
        $contentTypeCreateStruct->mainLanguageCode = self::DEFAULT_LANGUAGE;
        $contentTypeCreateStruct->names = array(self::DEFAULT_LANGUAGE => $name);
        $contentTypeCreateStruct->nameSchema = $name;
        $this->fieldConstructionObject['contentType'] = $contentTypeCreateStruct;
        $this->fieldConstructionObject['objectState'] = self::CONTENT_TYPE_CREATED;
    }