public function modelsCommand($services = [], $table_pattern = '', $namespace = 'App\Models', $optimized = false)
    {
        if (strpos($namespace, '\\') === false) {
            $namespace = 'App\\' . ucfirst($namespace) . '\\Models';
        }

        foreach ($services ?: $this->_getDbServices() as $service) {
            foreach ($this->_getTables($service, $table_pattern) as $table) {
                $this->console->progress(['`:table` processing...', 'table' => $table], '');

                $plainClass = Text::camelize($table);
                $fileName = "@tmp/db_models/$plainClass.php";
                $model_str = $this->_renderModel($service, $table, $namespace, $optimized);
                $this->filesystem->filePut($fileName, $model_str);

                $this->console->progress(['  `:table` table saved to `:file`', 'table' => $table, 'file' => $fileName]);
            }
        }
    }
public function modelsCommand($services = [], $table_pattern = '', $namespace = 'App\Models', $optimized = false)
    {
        if (strpos($namespace, '\\') === false) {
            $namespace = 'App\\' . ucfirst($namespace) . '\\Models';
        }

        foreach ($services ?: $this->_getDbServices() as $service) {
            foreach ($this->_getTables($service, $table_pattern) as $table) {
                $this->console->progress(['`:table` processing...', 'table' => $table], '');

                $plainClass = Text::camelize($table);
                $fileName = "@tmp/db_models/$plainClass.php";
                $model_str = $this->_renderModel($service, $table, $namespace, $optimized);
                $this->filesystem->filePut($fileName, $model_str);

                $this->console->progress(['  `:table` table saved to `:file`', 'table' => $table, 'file' => $fileName]);
            }
        }
    }
public function modelsCommand ( $ services = [ ] , $ table_pattern = '' , $ namespace = 'App\Models' , $ optimized = false ) { if ( strpos ( $ namespace , '\\' ) === false ) { $ namespace = 'App\\' . ucfirst ( $ namespace ) . '\\Models' ; } foreach ( $ services ? : $ this -> _getDbServices ( ) as $ service ) { foreach ( $ this -> _getTables ( $ service , $ table_pattern ) as $ table ) { $ this -> console -> progress ( [ '`:table` processing...' , 'table' => $ table ] , '' ) ; $ plainClass = Text :: camelize ( $ table ) ; $ fileName = "@tmp/db_models/$plainClass.php" ; $ model_str = $ this -> _renderModel ( $ service , $ table , $ namespace , $ optimized ) ; $ this -> filesystem -> filePut ( $ fileName , $ model_str ) ; $ this -> console -> progress ( [ '  `:table` table saved to `:file`' , 'table' => $ table , 'file' => $ fileName ] ) ; } } }
generate models file in online

@param array  $services services name list
@param string $table_pattern match table against a pattern
@param string $namespace namespace of models
@param bool   $optimized output as more methods as possible
generate models file in online