eZ\Publish\Core\SignalSlot\ContentTypeService::createContentType PHP Method

createContentType() public method

The content type is created in the state STATUS_DRAFT.
public createContentType ( eZ\Publish\API\Repository\Values\ContentType\ContentTypeCreateStruct $contentTypeCreateStruct, array $contentTypeGroups ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft
$contentTypeCreateStruct eZ\Publish\API\Repository\Values\ContentType\ContentTypeCreateStruct
$contentTypeGroups array Required array of {@link ContentTypeGroup} to link type with (must contain one)
return eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft
    public function createContentType(ContentTypeCreateStruct $contentTypeCreateStruct, array $contentTypeGroups)
    {
        $returnValue = $this->service->createContentType($contentTypeCreateStruct, $contentTypeGroups);
        $this->signalDispatcher->emit(new CreateContentTypeSignal(array('contentTypeId' => $returnValue->id)));
        return $returnValue;
    }