src/Draggy/Autocode/Project.php
public function getModelFiles($path)
    {
        $fileCollection = new FileCollection();

        $namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/');

        $targetPath = $namespacePath;

        foreach ($this->getEntities() as $entity) {
            if ($entity->getRenderizable()) {
                if ($this->getLanguage() === 'php') {
                    if ($entity->getNamespace() !== '') {
                        $targetPath = $path . str_replace('\\', '/', $entity->getNamespace()) . '/';
                    }
                } elseif ($this->getLanguage() === 'java') {
                    if ($entity->getModule() !== '') {
                        $targetPath = $path . '/' . $this->getAutocodeConfiguration('package') . '/' . str_replace('.', '/', $entity->getModule()) . '/';
                    }
                }

                foreach ($this->getAutocodeEntityTemplates() as $template) {
                    $fileCollection->add($this->renderEntityTemplate($template, $entity, $targetPath));
                }
            }
        }

        if ($this->getLanguage() === 'php') {
            foreach ($this->modules as $module) {
                $targetPath = $path . str_replace('\\', '/', $this->moduleNamespaces[$module]) . '/';

                foreach ($this->getAutocodeModuleTemplates() as $template) {
                    $fileCollection->add($this->renderModuleTemplate($this, $template, $module, $targetPath));
                }
            }
        }

        return $fileCollection;
    }
public function getModelFiles($path)
    {
        $fileCollection = new FileCollection();

        $namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/');

        $targetPath = $namespacePath;

        foreach ($this->getEntities() as $entity) {
            if ($entity->getRenderizable()) {
                if ($this->getLanguage() === 'php') {
                    if ($entity->getNamespace() !== '') {
                        $targetPath = $path . str_replace('\\', '/', $entity->getNamespace()) . '/';
                    }
                } elseif ($this->getLanguage() === 'java') {
                    if ($entity->getModule() !== '') {
                        $targetPath = $path . '/' . $this->getAutocodeConfiguration('package') . '/' . str_replace('.', '/', $entity->getModule()) . '/';
                    }
                }

                foreach ($this->getAutocodeEntityTemplates() as $template) {
                    $fileCollection->add($this->renderEntityTemplate($template, $entity, $targetPath));
                }
            }
        }

        if ($this->getLanguage() === 'php') {
            foreach ($this->modules as $module) {
                $targetPath = $path . str_replace('\\', '/', $this->moduleNamespaces[$module]) . '/';

                foreach ($this->getAutocodeModuleTemplates() as $template) {
                    $fileCollection->add($this->renderModuleTemplate($this, $template, $module, $targetPath));
                }
            }
        }

        return $fileCollection;
    }
public function getModelFiles ( $ path ) { $ fileCollection = new FileCollection ( ) ; $ namespacePath = str_replace ( '\\' , '/' , $ path . $ this -> getNamespace ( ) . '/' ) ; $ targetPath = $ namespacePath ; foreach ( $ this -> getEntities ( ) as $ entity ) { if ( $ entity -> getRenderizable ( ) ) { if ( $ this -> getLanguage ( ) === 'php' ) { if ( $ entity -> getNamespace ( ) !== '' ) { $ targetPath = $ path . str_replace ( '\\' , '/' , $ entity -> getNamespace ( ) ) . '/' ; } } elseif ( $ this -> getLanguage ( ) === 'java' ) { if ( $ entity -> getModule ( ) !== '' ) { $ targetPath = $ path . '/' . $ this -> getAutocodeConfiguration ( 'package' ) . '/' . str_replace ( '.' , '/' , $ entity -> getModule ( ) ) . '/' ; } } foreach ( $ this -> getAutocodeEntityTemplates ( ) as $ template ) { $ fileCollection -> add ( $ this -> renderEntityTemplate ( $ template , $ entity , $ targetPath ) ) ; } } } if ( $ this -> getLanguage ( ) === 'php' ) { foreach ( $ this -> modules as $ module ) { $ targetPath = $ path . str_replace ( '\\' , '/' , $ this -> moduleNamespaces [ $ module ] ) . '/' ; foreach ( $ this -> getAutocodeModuleTemplates ( ) as $ template ) { $ fileCollection -> add ( $ this -> renderModuleTemplate ( $ this , $ template , $ module , $ targetPath ) ) ; } } } return $ fileCollection ; }
Returns a collection of files

@param string $path The path where they would be saved

@return FileCollection
Returns a collection of files