public function generate($registry)
    {
        $context = $this->createContext($registry);

        $prettyPrinter = new Standard();
        $modelFiles = [];
        $normalizerFiles = [];

        foreach ($registry->getSchemas() as $schema) {
            if (!file_exists(($schema->getDirectory().DIRECTORY_SEPARATOR.'Model'))) {
                mkdir($schema->getDirectory().DIRECTORY_SEPARATOR.'Model', 0755, true);
            }

            if (!file_exists(($schema->getDirectory().DIRECTORY_SEPARATOR.'Normalizer'))) {
                mkdir($schema->getDirectory().DIRECTORY_SEPARATOR.'Normalizer', 0755, true);
            }

            $context->setCurrentSchema($schema);

            $modelFiles = array_merge($modelFiles, $this->modelGenerator->generate($schema, $schema->getRootName(), $context));
            $normalizerFiles = array_merge($normalizerFiles, $this->normalizerGenerator->generate($schema, $schema->getRootName(), $context));
        }

        $generated = [];

        foreach ($modelFiles as $file) {
            $generated[] = $file->getFilename();
            file_put_contents($file->getFilename(), $prettyPrinter->prettyPrintFile([$file->getNode()]));
        }

        foreach ($normalizerFiles as $file) {
            $generated[] = $file->getFilename();
            file_put_contents($file->getFilename(), $prettyPrinter->prettyPrintFile([$file->getNode()]));
        }

        foreach ($registry->getSchemas() as $schema) {
            $this->fix($schema->getDirectory());
        }

        return $generated;
    }
public function generate($registry)
    {
        $context = $this->createContext($registry);

        $prettyPrinter = new Standard();
        $modelFiles = [];
        $normalizerFiles = [];

        foreach ($registry->getSchemas() as $schema) {
            if (!file_exists(($schema->getDirectory().DIRECTORY_SEPARATOR.'Model'))) {
                mkdir($schema->getDirectory().DIRECTORY_SEPARATOR.'Model', 0755, true);
            }

            if (!file_exists(($schema->getDirectory().DIRECTORY_SEPARATOR.'Normalizer'))) {
                mkdir($schema->getDirectory().DIRECTORY_SEPARATOR.'Normalizer', 0755, true);
            }

            $context->setCurrentSchema($schema);

            $modelFiles = array_merge($modelFiles, $this->modelGenerator->generate($schema, $schema->getRootName(), $context));
            $normalizerFiles = array_merge($normalizerFiles, $this->normalizerGenerator->generate($schema, $schema->getRootName(), $context));
        }

        $generated = [];

        foreach ($modelFiles as $file) {
            $generated[] = $file->getFilename();
            file_put_contents($file->getFilename(), $prettyPrinter->prettyPrintFile([$file->getNode()]));
        }

        foreach ($normalizerFiles as $file) {
            $generated[] = $file->getFilename();
            file_put_contents($file->getFilename(), $prettyPrinter->prettyPrintFile([$file->getNode()]));
        }

        foreach ($registry->getSchemas() as $schema) {
            $this->fix($schema->getDirectory());
        }

        return $generated;
    }
public function generate ( $ registry ) { $ context = $ this -> createContext ( $ registry ) ; $ prettyPrinter = new Standard ( ) ; $ modelFiles = [ ] ; $ normalizerFiles = [ ] ; foreach ( $ registry -> getSchemas ( ) as $ schema ) { if ( ! file_exists ( ( $ schema -> getDirectory ( ) . DIRECTORY_SEPARATOR . 'Model' ) ) ) { mkdir ( $ schema -> getDirectory ( ) . DIRECTORY_SEPARATOR . 'Model' , 0755 , true ) ; } if ( ! file_exists ( ( $ schema -> getDirectory ( ) . DIRECTORY_SEPARATOR . 'Normalizer' ) ) ) { mkdir ( $ schema -> getDirectory ( ) . DIRECTORY_SEPARATOR . 'Normalizer' , 0755 , true ) ; } $ context -> setCurrentSchema ( $ schema ) ; $ modelFiles = array_merge ( $ modelFiles , $ this -> modelGenerator -> generate ( $ schema , $ schema -> getRootName ( ) , $ context ) ) ; $ normalizerFiles = array_merge ( $ normalizerFiles , $ this -> normalizerGenerator -> generate ( $ schema , $ schema -> getRootName ( ) , $ context ) ) ; } $ generated = [ ] ; foreach ( $ modelFiles as $ file ) { $ generated [ ] = $ file -> getFilename ( ) ; file_put_contents ( $ file -> getFilename ( ) , $ prettyPrinter -> prettyPrintFile ( [ $ file -> getNode ( ) ] ) ) ; } foreach ( $ normalizerFiles as $ file ) { $ generated [ ] = $ file -> getFilename ( ) ; file_put_contents ( $ file -> getFilename ( ) , $ prettyPrinter -> prettyPrintFile ( [ $ file -> getNode ( ) ] ) ) ; } foreach ( $ registry -> getSchemas ( ) as $ schema ) { $ this -> fix ( $ schema -> getDirectory ( ) ) ; } return $ generated ; }
Generate code.

@param Registry $registry

@return array
Generate code .