Action/BuildAction.php
protected function dumpModelClasses(CLImate $climate, $bundle)
    {
        if (is_array($this->tablesModel[$bundle])) {
            foreach ($this->tablesModel[$bundle] as $tableSpec) {
                $alias = $tableSpec['alias'];
                if ($tableSpec['tableClass']) {
                    $tableClassPath = SRC_DIR . DS . str_replace('\\', '/', $tableSpec['tableClass']) . '.php';
                    $tableClassDir = dirname($tableClassPath);
                    $tableClassName = trim(
                        substr($tableSpec['tableClass'], strrpos($tableSpec['tableClass'], '\\')),
                        '\\'
                    );
                    $tableClassNamespace = trim(
                        substr($tableSpec['tableClass'], 0, strrpos($tableSpec['tableClass'], '\\')),
                        '\\'
                    );

                    if (!is_file($tableClassPath)) {
                        if (!is_dir($tableClassDir)) {
                            mkdir($tableClassDir, 0777, true);
                        }

                        ob_start();
                        echo '<?php';
                        include Bundles::getPath('CakeOrm') . '/Resource/config/table_template.php';
                        $content = ob_get_contents();
                        ob_end_clean();

                        file_put_contents($tableClassPath, $content);
                        $climate->lightGray(sprintf('Create table class "%s".', $tableSpec['tableClass']));
                    } else {
                        $climate->lightMagenta(sprintf('Table class "%s" exists.', $tableSpec['tableClass']));
                    }
                }

                //if ($tableSpec['entityClass']) {
                //    $entityClassPath = SRC_DIR . DS . str_replace('\\', '/', $tableSpec['entityClass']);
                //    $entityClassName = trim(
                //        substr($tableSpec['entityClass'], strrpos($tableSpec['entityClass'], '\\')),
                //        '\\'
                //    );
                //}
            }
        }
    }
protected function dumpModelClasses(CLImate $climate, $bundle)
    {
        if (is_array($this->tablesModel[$bundle])) {
            foreach ($this->tablesModel[$bundle] as $tableSpec) {
                $alias = $tableSpec['alias'];
                if ($tableSpec['tableClass']) {
                    $tableClassPath = SRC_DIR . DS . str_replace('\\', '/', $tableSpec['tableClass']) . '.php';
                    $tableClassDir = dirname($tableClassPath);
                    $tableClassName = trim(
                        substr($tableSpec['tableClass'], strrpos($tableSpec['tableClass'], '\\')),
                        '\\'
                    );
                    $tableClassNamespace = trim(
                        substr($tableSpec['tableClass'], 0, strrpos($tableSpec['tableClass'], '\\')),
                        '\\'
                    );

                    if (!is_file($tableClassPath)) {
                        if (!is_dir($tableClassDir)) {
                            mkdir($tableClassDir, 0777, true);
                        }

                        ob_start();
                        echo '<?php';
                        include Bundles::getPath('CakeOrm') . '/Resource/config/table_template.php';
                        $content = ob_get_contents();
                        ob_end_clean();

                        file_put_contents($tableClassPath, $content);
                        $climate->lightGray(sprintf('Create table class "%s".', $tableSpec['tableClass']));
                    } else {
                        $climate->lightMagenta(sprintf('Table class "%s" exists.', $tableSpec['tableClass']));
                    }
                }

                //if ($tableSpec['entityClass']) {
                //    $entityClassPath = SRC_DIR . DS . str_replace('\\', '/', $tableSpec['entityClass']);
                //    $entityClassName = trim(
                //        substr($tableSpec['entityClass'], strrpos($tableSpec['entityClass'], '\\')),
                //        '\\'
                //    );
                //}
            }
        }
    }
protected function dumpModelClasses ( CLImate $ climate , $ bundle ) { if ( is_array ( $ this -> tablesModel [ $ bundle ] ) ) { foreach ( $ this -> tablesModel [ $ bundle ] as $ tableSpec ) { $ alias = $ tableSpec [ 'alias' ] ; if ( $ tableSpec [ 'tableClass' ] ) { $ tableClassPath = SRC_DIR . DS . str_replace ( '\\' , '/' , $ tableSpec [ 'tableClass' ] ) . '.php' ; $ tableClassDir = dirname ( $ tableClassPath ) ; $ tableClassName = trim ( substr ( $ tableSpec [ 'tableClass' ] , strrpos ( $ tableSpec [ 'tableClass' ] , '\\' ) ) , '\\' ) ; $ tableClassNamespace = trim ( substr ( $ tableSpec [ 'tableClass' ] , 0 , strrpos ( $ tableSpec [ 'tableClass' ] , '\\' ) ) , '\\' ) ; if ( ! is_file ( $ tableClassPath ) ) { if ( ! is_dir ( $ tableClassDir ) ) { mkdir ( $ tableClassDir , 0777 , true ) ; } ob_start ( ) ; echo '<?php' ; include Bundles :: getPath ( 'CakeOrm' ) . '/Resource/config/table_template.php' ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; file_put_contents ( $ tableClassPath , $ content ) ; $ climate -> lightGray ( sprintf ( 'Create table class "%s".' , $ tableSpec [ 'tableClass' ] ) ) ; } else { $ climate -> lightMagenta ( sprintf ( 'Table class "%s" exists.' , $ tableSpec [ 'tableClass' ] ) ) ; } } //if ($tableSpec['entityClass']) { //    $entityClassPath = SRC_DIR . DS . str_replace('\\', '/', $tableSpec['entityClass']); //    $entityClassName = trim( //        substr($tableSpec['entityClass'], strrpos($tableSpec['entityClass'], '\\')), //        '\\' //    ); //} } } }
Dump model classes

@param CLImate $climate
@param string  $bundle
Dump model classes