CustomFieldsfield to your
custom_fieldsto your entities' database table via migration
FieldCollection. That's already it for your custom entity definition. Now go ahead and add the column to the database.
JSONto your migration.
custom_fieldscolumn here. It has to be a JSON field and should default to
NULL, since it doesn't have to contain values.
TranslatedFieldhere as well.
customFieldsas a parameter.
custom_fieldscolumn of your entities' database table via the DAL. Defining a custom field set is only necessary, if you want it to be editable in the administration or if you need validation when writing your custom field.
exampleentity up and running and now you want to add data to its custom fields via the DAL.
swag_example_sizewith its value
15to your entity. And you haven't even defined the custom field
custom_field_set.repositorykey and is used like any other repository. If you don't know how that is done, head over to our guide regarding Writing data.
createmethod of the repository to create a new custom field set.
swag_example_setand the field we already used in the previous step,
swag_example_size. This time we also define its type, which should be of type integer here. The type is important to mention, because the administration will use this information to display a proper field. Also, when trying to write the custom field
swag_example_size, the value has to be an integer.