$fields =
new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new ApiAware(),
new PrimaryKey(),
new Required()),
(new StringField('technical_name', 'technicalName'
))->
addFlags(new ApiAware()),
(new StringField('name', 'name'
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new StringField('author', 'author'
))->
addFlags(new ApiAware(),
new Required()),
(new TranslatedField('description'
))->
addFlags(new ApiAware()),
(new TranslatedField('labels'
))->
addFlags(new ApiAware()),
(new TranslatedField('helpTexts'
))->
addFlags(new ApiAware()),
(new TranslatedField('customFields'
))->
addFlags(new ApiAware()),
(new FkField('preview_media_id', 'previewMediaId', MediaDefinition::
class))->
addFlags(new ApiAware()),
(new FkField('parent_theme_id', 'parentThemeId', self::
class))->
addFlags(new ApiAware()),
new JsonField('theme_json', 'themeJson'
),
(new JsonField('base_config', 'baseConfig'
))->
addFlags(new ApiAware()),
(new JsonField('config_values', 'configValues'
))->
addFlags(new ApiAware()),
(new BoolField('active', 'active'
))->
addFlags(new ApiAware(),
new Required()),
(new TranslationsAssociationField(ThemeTranslationDefinition::
class, 'theme_id'
))->
addFlags(new Required()),
new ManyToManyAssociationField('salesChannels', SalesChannelDefinition::
class, ThemeSalesChannelDefinition::
class, 'theme_id', 'sales_channel_id'
),
(new ManyToManyAssociationField('media', MediaDefinition::
class, ThemeMediaDefinition::
class, 'theme_id', 'media_id'
))->
addFlags(new ApiAware()),
new ManyToOneAssociationField('previewMedia', 'preview_media_id', MediaDefinition::
class),
]);
$fields->
add(new ManyToManyAssociationField('dependentThemes', ThemeDefinition::
class, ThemeChildDefinition::
class, 'parent_id', 'child_id'
));