@@ -68,7 +68,7 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs)
68
68
/* @var $column Column */
69
69
$ column = $ entityTable ->getColumn ('id ' );
70
70
$ revisionTable ->addColumn ($ column ->getName (), $ column ->getType ()->getName (), array_merge (
71
- $ column -> toArray ( ),
71
+ $ this -> getColumnOptions ( $ column ),
72
72
array ('notnull ' => false , 'autoincrement ' => false )
73
73
));
74
74
}
@@ -82,7 +82,7 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs)
82
82
if ($ column ->getName () == 'id ' ) continue ;
83
83
/* @var $column Column */
84
84
$ revisionTable ->addColumn ($ column ->getName (), $ column ->getType ()->getName (), array_merge (
85
- $ column -> toArray ( ),
85
+ $ this -> getColumnOptions ( $ column ),
86
86
array ('notnull ' => false , 'autoincrement ' => false )
87
87
));
88
88
}
@@ -93,4 +93,17 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs)
93
93
$ revisionTable ->setPrimaryKey ($ pkColumns );
94
94
}
95
95
}
96
+
97
+ /**
98
+ * Get all the options for a column, uses the toArray method and removes the keys that are not relevant
99
+ */
100
+ private function getColumnOptions (Column $ column ): array
101
+ {
102
+ $ columnArray = $ column ->toArray ();
103
+ unset($ columnArray ['name ' ]);
104
+ unset($ columnArray ['type ' ]);
105
+ unset($ columnArray ['version ' ]);
106
+
107
+ return $ columnArray ;
108
+ }
96
109
}
0 commit comments