File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
.settings /
3
3
.project
4
4
vendor /
5
+ .idea /
Original file line number Diff line number Diff line change 4
4
use Ubiquity \db \reverse \DbGenerator ;
5
5
use Ubiquity \controllers \Startup ;
6
6
use Ubiquity \cache \CacheManager ;
7
+ use Ubiquity \orm \DAO ;
7
8
8
9
/**
9
10
* Generates database from models.
@@ -23,11 +24,23 @@ class DatabaseReversor {
23
24
24
25
private $ models ;
25
26
27
+ private $ databaseMetas ;
28
+
26
29
public function __construct (DbGenerator $ generator , $ databaseOffset = 'default ' ) {
27
30
$ this ->generator = $ generator ;
28
31
$ this ->database = $ databaseOffset ;
29
32
}
30
33
34
+ public function getDatabaseMeta (){
35
+ $ db =DAO ::getDatabase ();
36
+ if ($ db ->isConnected ()){
37
+ $ tables =$ db ->getTablesName ();
38
+ foreach ($ tables as $ table ){
39
+ $ this ->databaseMetas [$ table ]=;
40
+ }
41
+ }
42
+ }
43
+
31
44
public function createDatabase (string $ name , bool $ createDb = true ): void {
32
45
if ($ createDb ) {
33
46
$ this ->generator ->createDatabase ($ name );
You can’t perform that action at this time.
0 commit comments