@@ -103,34 +103,42 @@ public function handle(): int
103
103
// Create Attributes
104
104
$ attributes = '' ;
105
105
foreach ($ columns as $ _column ) {
106
- $ attributes = substr_replace ($ attributes ,
107
- $ this ->writeAttribute ($ attributeStub , $ _column ->COLUMN_NAME , ($ _column ->IS_NULLABLE === 'YES ' ? '? ' : '' ) . $ this ->dataTypes [$ _column ->DATA_TYPE ]),
108
- -1 , 0 );
106
+ $ attributes .= $ this ->writeAttribute (
107
+ $ attributeStub ,
108
+ $ _column ->COLUMN_NAME ,
109
+ ($ _column ->IS_NULLABLE === 'YES ' ? '? ' : '' ) . $ this ->dataTypes [$ _column ->DATA_TYPE ]
110
+ );
109
111
}
110
112
111
113
// Create Setters and Getters
112
114
$ settersAndGetters = '' ;
113
115
foreach ($ columns as $ _column ) {
114
- $ settersAndGetters = substr_replace ($ settersAndGetters ,
115
- $ this ->writeAccessors ($ accessorsStub , $ _column ->COLUMN_NAME , ($ _column ->IS_NULLABLE === 'YES ' ? '? ' : '' ) . $ this ->dataTypes [$ _column ->DATA_TYPE ]),
116
- -1 , 0 );
116
+ $ settersAndGetters .= $ this ->writeAccessors (
117
+ $ accessorsStub ,
118
+ $ _column ->COLUMN_NAME ,
119
+ ($ _column ->IS_NULLABLE === 'YES ' ? '? ' : '' ) . $ this ->dataTypes [$ _column ->DATA_TYPE ]
120
+ );
117
121
}
118
122
119
123
if ($ detectForeignKeys ) {
120
124
$ foreignKeys = $ this ->extractForeignKeys ($ tableName );
121
125
122
126
// Create Additional Attributes from Foreign Keys
123
127
foreach ($ foreignKeys as $ _foreignKey ) {
124
- $ attributes = substr_replace ($ attributes ,
125
- $ this ->writeAttribute ($ attributeStub , $ _foreignKey ->VARIABLE_NAME , $ _foreignKey ->ENTITY_DATA_TYPE ),
126
- -1 , 0 );
128
+ $ attributes .= $ this ->writeAttribute (
129
+ $ attributeStub ,
130
+ $ _foreignKey ->VARIABLE_NAME ,
131
+ $ _foreignKey ->ENTITY_DATA_TYPE
132
+ );
127
133
}
128
134
129
135
// Create Additional Setters and Getters from Foreign keys
130
136
foreach ($ foreignKeys as $ _foreignKey ) {
131
- $ settersAndGetters = substr_replace ($ settersAndGetters ,
132
- $ this ->writeAccessors ($ accessorsStub , $ _foreignKey ->VARIABLE_NAME , $ _foreignKey ->ENTITY_DATA_TYPE ),
133
- -1 , 0 );
137
+ $ settersAndGetters .= $ this ->writeAccessors (
138
+ $ accessorsStub ,
139
+ $ _foreignKey ->VARIABLE_NAME ,
140
+ $ _foreignKey ->ENTITY_DATA_TYPE
141
+ );
134
142
}
135
143
}
136
144
@@ -148,4 +156,4 @@ public function handle(): int
148
156
149
157
return 0 ;
150
158
}
151
- }
159
+ }
0 commit comments