src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php
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);
    }
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);
    }
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 ) ; }
generate document part of a resource

@param array  $parameters twig parameters
@param string $dir        base bundle dir
@param string $document   document name

@return void
generate document part of a resource