protected function defineFields(): FieldCollection
{ return new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new PrimaryKey(),
new Required()),
new BoolField('use_parent_configuration', 'useParentConfiguration'
),
(new FkField('media_folder_configuration_id', 'configurationId', MediaFolderConfigurationDefinition::
class))->
addFlags(new Required()),
new FkField('default_folder_id', 'defaultFolderId', MediaDefaultFolderDefinition::
class),
new ParentFkField(self::
class),
new ParentAssociationField(self::
class, 'id'
),
new ChildrenAssociationField(self::
class),
new ChildCountField(),
new TreePathField('path', 'path'
),
(new OneToManyAssociationField('media', MediaDefinition::
class, 'media_folder_id'
))->
addFlags(new SetNullOnDelete()),
new OneToOneAssociationField('defaultFolder', 'default_folder_id', 'id', MediaDefaultFolderDefinition::
class, false
),
new ManyToOneAssociationField('configuration', 'media_folder_configuration_id', MediaFolderConfigurationDefinition::
class, 'id', false
),
(new StringField('name', 'name'
))->
addFlags(new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
),
new Required()),
new CustomFields(),
]);
}}