@@ -170,20 +170,35 @@ public static function controller() {
170170 ], 'controllers ' );
171171 }
172172
173+ public static function genModel () {
174+ return new Command ("model " , "tableName " , "Generates a new model from an existing table. " , [
175+ 'gen_model ' ,
176+ 'gen:model ' ,
177+ 'gen-model ' ,
178+ 'genModel '
179+ ], [
180+ 'd ' => Parameter::create ('database ' , 'The database connection to use ' , [], 'default ' ),
181+ 'a ' => Parameter::create ('access ' , 'The default access to the class members ' , [], 'private ' ),
182+ 'o ' => Parameter::create ('domain ' , 'The domain in which to create the model. ' , [], '' )
183+ ], [
184+ 'Ubiquity genModel User ' ,
185+ 'Ubiquity genModel Author -d=projects ' ,
186+ 'Ubiquity genModel Author -d=projects -a=protected '
187+ ], 'models ' );
188+ }
189+
173190 public static function model () {
174- return new Command ("model " , "tableName " , "Generates a new model. " , [
191+ return new Command ("model " , "modelName " , "Generates a new model from scratch . " , [
175192 'create_model ' ,
176193 'create:model ' ,
177194 'create-model ' ,
178195 'createModel '
179196 ], [
180197 'd ' => Parameter::create ('database ' , 'The database connection to use ' , [], 'default ' ),
181- 'a ' => Parameter::create ('access ' , 'The default access to the class members ' , [], 'private ' ),
182198 'o ' => Parameter::create ('domain ' , 'The domain in which to create the model. ' , [], '' )
183199 ], [
184200 'Ubiquity model User ' ,
185- 'Ubiquity model Author -d=projects ' ,
186- 'Ubiquity model Author -d=projects -a=protected '
201+ 'Ubiquity model Author -d=projects '
187202 ], 'models ' );
188203 }
189204
@@ -852,6 +867,7 @@ public static function getCommands() {
852867 self ::help (),
853868 self ::version (),
854869 self ::model (),
870+ self ::genModel (),
855871 self ::allModels (),
856872 self ::infoMigrations (),
857873 self ::migrations (),
0 commit comments