protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        /** @var $repository Repository */
        $repository = $this->getContainer()->get('ezpublish.api.repository');

        /** @var $contentTypeService ContentTypeService */
        $contentTypeService = $repository->getContentTypeService();
        /** @var $contentLanguageService LanguageService */
        $contentLanguageService = $repository->getContentLanguageService();

        /** @var $questionHelper QuestionHelper */
        $questionHelper = $this->getHelper('question');

        $struct = array();

        $struct['contentTypeGroup'] = $this->getContentTypeGroup($contentTypeService, $questionHelper);
        $struct['contentTypeIdentifier'] = $this->getContentTypeIdentifier($questionHelper);
        $struct['contentTypeName'] = $this->getContentTypeName($questionHelper);
        $struct['contentTypeMainLanguage'] = $this->getContentTypeMainLanguage($contentLanguageService, $questionHelper);
        $struct['contentTypeNameSchema'] = $this->getContentTypeNameSchema($questionHelper);
        $struct['fields'] = array();

        while (true) {
            $struct['fields'][] = $this->getContentTypeField($questionHelper, $struct['contentTypeMainLanguage']);
            $question = new ConfirmationQuestion(
                '<question>Do you want to add new field?</question> ',
                false
            );

            if (!$questionHelper->ask($input, $output, $question)) {
                $output->writeln('');
                break;
            }
        }

        /** @var $configResolver ConfigResolver */
        $configResolver = $this->getContainer()->get('ezpublish.config.resolver');
        $adminID = $configResolver->getParameter('adminid', 'smile_ez_tools');

        $contentTypeService = new ContentType($repository);
        $contentTypeService->setAdminID($adminID);
        try {
            $contentTypeService->add($struct);
            $output->writeln("<info>Content type created</info>");
        } catch (UnauthorizedException $e) {
            $output->writeln("<error>" . $e->getMessage() . "</error>");
        } catch (ForbiddenException $e ) {
            $output->writeln("<error>" . $e->getMessage() . "</error>");
        }
    }