File tree Expand file tree Collapse file tree
WebFiori/Framework/Writers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ public function writeClassComment() {
5555
5656 // Add Column attributes
5757 foreach ($ this ->columns as $ col ) {
58- $ attr = "#[Column(name: ' {$ col ['name ' ]}', type: DataType:: {$ col ['type ' ]}" ;
58+ $ type = strtoupper ($ col ['type ' ]);
59+ $ attr = "#[Column(name: ' {$ col ['name ' ]}', type: DataType:: {$ type }" ;
5960
6061 if (isset ($ col ['size ' ])) {
6162 $ attr .= ", size: {$ col ['size ' ]}" ;
@@ -69,7 +70,18 @@ public function writeClassComment() {
6970 if (isset ($ col ['nullable ' ]) && $ col ['nullable ' ]) {
7071 $ attr .= ", nullable: true " ;
7172 }
72-
73+ if (isset ($ col ['identity ' ]) && $ col ['identity ' ]) {
74+ $ attr .= ", identity: true " ;
75+ }
76+ if (isset ($ col ['autoUpdate ' ]) && $ col ['autoUpdate ' ]) {
77+ $ attr .= ", autoUpdate: true " ;
78+ }
79+ if (isset ($ col ['default ' ])) {
80+ $ attr .= ", default: " .$ col ['default ' ];
81+ }
82+ if (isset ($ col ['comment ' ]) && strlen ($ col ['comment ' ]) != 0 ) {
83+ $ attr .= ", comment: " .$ col ['comment ' ];
84+ }
7385 $ attr .= ')] ' ;
7486 $ this ->append ($ attr , 0 );
7587 }
You can’t perform that action at this time.
0 commit comments