new LongTextField('file_name', 'fileName'
))->
addFlags(new ApiAware(),
new WriteProtected(Context::SYSTEM_SCOPE
),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new IntField('file_size', 'fileSize'
))->
addFlags(new ApiAware(),
new WriteProtected(Context::SYSTEM_SCOPE
)),
(new BlobField('media_type', 'mediaTypeRaw'
))->
removeFlag(ApiAware::
class)->
addFlags(new WriteProtected(Context::SYSTEM_SCOPE
)),
(new JsonField('meta_data', 'metaData'
))->
addFlags(new ApiAware(),
new WriteProtected(Context::SYSTEM_SCOPE
)),
(new JsonField('media_type', 'mediaType'
))->
addFlags(new WriteProtected(),
new Runtime()),
(new TranslatedField('alt'
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING
)),
(new TranslatedField('title'
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new StringField('url', 'url'
))->
addFlags(new ApiAware(),
new Runtime()),
(new BoolField('has_file', 'hasFile'
))->
addFlags(new ApiAware(),
new Runtime()),
(new BoolField('private', 'private'
))->
addFlags(new ApiAware()),
(new TranslatedField('customFields'
))->
addFlags(new ApiAware()),
(new BlobField('thumbnails_ro', 'thumbnailsRo'
))->
removeFlag(ApiAware::
class)->
addFlags(new Computed()),
(new TranslationsAssociationField(MediaTranslationDefinition::
class, 'media_id'
))->
addFlags(new ApiAware(),
new Required()),
(new ManyToManyAssociationField('tags', TagDefinition::
class, MediaTagDefinition::
class, 'media_id', 'tag_id'
))->
addFlags(new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING
)),
(new OneToManyAssociationField('thumbnails', MediaThumbnailDefinition::
class, 'media_id'
))->
addFlags(new ApiAware(),
new CascadeDelete()),
// reverse side of the associations, not available in store-api
new ManyToOneAssociationField('user', 'user_id', UserDefinition::
class, 'id', false
),
(new OneToManyAssociationField('categories', CategoryDefinition::
class, 'media_id', 'id'
))->
addFlags(new SetNullOnDelete()),
(new OneToManyAssociationField('productManufacturers', ProductManufacturerDefinition::
class, 'media_id', 'id'
))->
addFlags(new SetNullOnDelete()),
(new OneToManyAssociationField('productMedia', ProductMediaDefinition::
class, 'media_id', 'id'
))->
addFlags(new CascadeDelete()),
(new OneToManyAssociationField('productDownloads', ProductDownloadDefinition::
class, 'media_id', 'id'
))->
addFlags(new RestrictDelete()),
(new OneToManyAssociationField('orderLineItemDownloads', OrderLineItemDownloadDefinition::
class, 'media_id', 'id'
))->
addFlags(new RestrictDelete()),
(new OneToManyAssociationField('avatarUsers', UserDefinition::
class, 'avatar_id'
))->
addFlags(new SetNullOnDelete()),