@@ -18,6 +18,7 @@ class MakeAll extends Command
18
18
protected $ signature = 'repository:make-all
19
19
{--selected_db= : Main database}
20
20
{--table_names= : Table names, separate names with comma}
21
+ {--strategy_name= : strategy name}
21
22
{--k|foreign-keys : Detect foreign keys}
22
23
{--d|delete : Delete resource}
23
24
{--f|force : Override/Delete existing classes}
@@ -36,12 +37,20 @@ class MakeAll extends Command
36
37
*/
37
38
public function handle ()
38
39
{
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
+
39
48
$ this ->selectedDb = $ this ->hasOption ('selected_db ' ) && $ this ->option ('selected_db ' ) ? $ this ->option ('selected_db ' ) : config ('repository.default_db ' );
40
49
$ force = $ this ->option ('force ' );
41
50
$ delete = $ this ->option ('delete ' );
42
51
$ detectForeignKeys = $ this ->option ('foreign-keys ' );
43
52
$ addToGit = $ this ->option ('add-to-git ' );
44
-
53
+ $ strategy = $ this -> option ( ' strategy_name ' );
45
54
if ($ this ->option ('all-tables ' )) {
46
55
$ tableNames = $ this ->getAllTableNames ()->pluck ('TABLE_NAME ' );
47
56
} else if ($ this ->option ('table_names ' )) {
@@ -59,15 +68,14 @@ public function handle()
59
68
'--force ' => $ force ,
60
69
'--add-to-git ' => $ addToGit
61
70
];
62
-
63
71
$ this ->call ('repository:make-entity ' , $ arguments );
64
72
$ this ->call ('repository:make-enum ' , ['table_name ' => $ _tableName , '--delete ' => $ delete , '--force ' => $ force , '--add-to-git ' => $ addToGit ]);
65
73
$ this ->call ('repository:make-factory ' , ['table_name ' => $ _tableName , '--delete ' => $ delete , '--force ' => $ force , '--add-to-git ' => $ addToGit ]);
66
74
$ this ->call ('repository:make-resource ' , $ arguments );
67
75
$ this ->call ('repository:make-interface-repository ' , $ arguments );
68
76
$ 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 ]);
71
79
}
72
80
}
73
81
}
0 commit comments