@@ -18,6 +18,7 @@ class MakeAll extends Command
1818 protected $ signature = 'repository:make-all
1919 {--selected_db= : Main database}
2020 {--table_names= : Table names, separate names with comma}
21+ {--strategy_name= : strategy name}
2122 {--k|foreign-keys : Detect foreign keys}
2223 {--d|delete : Delete resource}
2324 {--f|force : Override/Delete existing classes}
@@ -36,12 +37,20 @@ class MakeAll extends Command
3637 */
3738 public function handle ()
3839 {
40+
41+
42+ $ strategyNames = array ("ClearableTemporaryCacheStrategy " , "QueryCacheStrategy " , "SingleKeyCacheStrategy " , "TemporaryCacheStrategy " );
43+ if (!in_array ($ this ->option ('strategy_name ' ), $ strategyNames )) {
44+ $ this ->alert ("This pattern strategy does not exist !!! " );
45+ exit ;
46+ }
47+
3948 $ this ->selectedDb = $ this ->hasOption ('selected_db ' ) && $ this ->option ('selected_db ' ) ? $ this ->option ('selected_db ' ) : config ('repository.default_db ' );
4049 $ force = $ this ->option ('force ' );
4150 $ delete = $ this ->option ('delete ' );
4251 $ detectForeignKeys = $ this ->option ('foreign-keys ' );
4352 $ addToGit = $ this ->option ('add-to-git ' );
44-
53+ $ strategy = $ this -> option ( ' strategy_name ' );
4554 if ($ this ->option ('all-tables ' )) {
4655 $ tableNames = $ this ->getAllTableNames ()->pluck ('TABLE_NAME ' );
4756 } else if ($ this ->option ('table_names ' )) {
@@ -59,15 +68,14 @@ public function handle()
5968 '--force ' => $ force ,
6069 '--add-to-git ' => $ addToGit
6170 ];
62-
6371 $ this ->call ('repository:make-entity ' , $ arguments );
6472 $ this ->call ('repository:make-enum ' , ['table_name ' => $ _tableName , '--delete ' => $ delete , '--force ' => $ force , '--add-to-git ' => $ addToGit ]);
6573 $ this ->call ('repository:make-factory ' , ['table_name ' => $ _tableName , '--delete ' => $ delete , '--force ' => $ force , '--add-to-git ' => $ addToGit ]);
6674 $ this ->call ('repository:make-resource ' , $ arguments );
6775 $ this ->call ('repository:make-interface-repository ' , $ arguments );
6876 $ this ->call ('repository:make-mysql-repository ' , $ arguments );
69- $ this ->call ('repository:make-redis-repository ' , $ arguments );
70- $ this ->call ('repository:make-repository ' , [...$ arguments ,'selected_db ' =>$ this ->selectedDb ]);
77+ $ this ->call ('repository:make-redis-repository ' ,[... $ arguments, ' strategy ' => $ strategy ] );
78+ $ this ->call ('repository:make-repository ' , [...$ arguments ,'strategy ' => $ strategy , ' selected_db ' =>$ this ->selectedDb ]);
7179 }
7280 }
7381}
0 commit comments