protected function defineFields(): FieldCollection
{ $collection =
new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new ApiAware(),
new PrimaryKey(),
new Required()),
(new ParentFkField(self::
class))->
addFlags(new ApiAware()),
(new FkField('locale_id', 'localeId', LocaleDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('translation_code_id', 'translationCodeId', LocaleDefinition::
class))->
addFlags(new ApiAware()),
(new StringField('name', 'name'
))->
addFlags(new ApiAware(),
new Required()),
(new CustomFields())->
addFlags(new ApiAware()),
(new ParentAssociationField(self::
class, 'id'
))->
addFlags(new ApiAware()),
(new ManyToOneAssociationField('locale', 'locale_id', LocaleDefinition::
class, 'id', false
))->
addFlags(new ApiAware()),
(new ManyToOneAssociationField('translationCode', 'translation_code_id', LocaleDefinition::
class, 'id', false
))->
addFlags(new ApiAware()),
(new ChildrenAssociationField(self::
class))->
addFlags(new ApiAware()),
new ManyToManyAssociationField('salesChannels', SalesChannelDefinition::
class, SalesChannelLanguageDefinition::
class, 'language_id', 'sales_channel_id'
),
new OneToManyAssociationField('salesChannelDefaultAssignments', SalesChannelDefinition::
class, 'language_id', 'id'
),
(new OneToManyAssociationField('salesChannelDomains', SalesChannelDomainDefinition::
class, 'language_id'
))->
addFlags(new RestrictDelete()),
(new OneToManyAssociationField('customers', CustomerDefinition::
class, 'language_id'
))->
addFlags(new RestrictDelete()),
(new OneToManyAssociationField('newsletterRecipients', NewsletterRecipientDefinition::
class, 'language_id', 'id'
))->
addFlags(new RestrictDelete()),
(new OneToManyAssociationField('orders', OrderDefinition::
class, 'language_id', 'id'
))->
addFlags(new RestrictDelete()),