protected function generateDocument($parameters, $dir, $document)
    {
        // doctrine mapping normal class
        $this->renderFile(
            'document/Document.mongodb.yml.twig',
            $dir . '/Resources/config/doctrine/' . $document . '.mongodb.yml',
            $parameters
        );

        // doctrine mapping embedded
        $this->renderFile(
            'document/Document.mongodb.yml.twig',
            $dir . '/Resources/config/doctrine/' . $document . 'Embedded.mongodb.yml',
            array_merge(
                $parameters,
                [
                    'document' => $document.'Embedded',
                    'docType' => 'embeddedDocument'
                ]
            )
        );

        $this->renderFile(
            'document/Document.php.twig',
            $dir . '/Document/' . $document . '.php',
            $parameters
        );
        $this->renderFile(
            'document/DocumentEmbedded.php.twig',
            $dir . '/Document/' . $document . 'Embedded.php',
            $parameters
        );
        $this->renderFile(
            'document/DocumentBase.php.twig',
            $dir . '/Document/' . $document . 'Base.php',
            $parameters
        );

        $this->generateServices($parameters, $dir, $document);
    }