private function defineTable(Schema
$schema, string
$name, array
$fields): void
{ $table =
$this->
createTable($schema,
$name);
// Id columns do not need to be defined in the .xml, we do this automatically
$table->
addColumn('id', Types::BINARY,
['length' => 16, 'fixed' => true
]);
$table->
setPrimaryKey(['id'
]);
// important: we add a `comment` to the table. This allows us to identify the custom entity modifications when run the cleanup
$table->
setComment(self::COMMENT
);
// we have to add only fields, which are not marked as translated
$filtered =
array_filter($fields,
fn (array
$field) => ($field['translatable'
] ?? false
) === false
);
$filtered =
array_filter($filtered,
fn (array
$field) => !
$this->
isAssociation($field));
$this->
addColumns($schema,
$table,
$filtered);
$binary =
['length' => 16, 'fixed' => true
];
$translated =
array_filter($fields,
fn (array
$field) =>
$field['translatable'
] ?? false
);