SolveConsole/Controllers/GenController.php
public function modelAction() {
        $name = ucfirst(Inflector::camelize($this->getFirstParamOrAsk('Enter model name')));
        $path = DC::getEnvironment()->getUserClassesRoot() . 'db/';
        $mo   = ModelOperator::getInstance($path);
        if ($mo->getModelStructure($name)) {
            $this->warning('model ' . $name . ' is already exists', '~ model exists, skipping:');
            return true;
        }
        $mo->generateBasicStructure($name);
        $mo->saveModelStructure($name);
        $this->notify($path . 'structure/' . $name . '.yml', '+ model created');
    }
public function modelAction() {
        $name = ucfirst(Inflector::camelize($this->getFirstParamOrAsk('Enter model name')));
        $path = DC::getEnvironment()->getUserClassesRoot() . 'db/';
        $mo   = ModelOperator::getInstance($path);
        if ($mo->getModelStructure($name)) {
            $this->warning('model ' . $name . ' is already exists', '~ model exists, skipping:');
            return true;
        }
        $mo->generateBasicStructure($name);
        $mo->saveModelStructure($name);
        $this->notify($path . 'structure/' . $name . '.yml', '+ model created');
    }
public function modelAction ( ) { $ name = ucfirst ( Inflector :: camelize ( $ this -> getFirstParamOrAsk ( 'Enter model name' ) ) ) ; $ path = DC :: getEnvironment ( ) -> getUserClassesRoot ( ) . 'db/' ; $ mo = ModelOperator :: getInstance ( $ path ) ; if ( $ mo -> getModelStructure ( $ name ) ) { $ this -> warning ( 'model ' . $ name . ' is already exists' , '~ model exists, skipping:' ) ; return true ; } $ mo -> generateBasicStructure ( $ name ) ; $ mo -> saveModelStructure ( $ name ) ; $ this -> notify ( $ path . 'structure/' . $ name . '.yml' , '+ model created' ) ; }
Generates default database model structure
Generates default database model structure