Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMediaGalleryDefinition example
$this
->
configureRegistry
(
[
'Media' =>
$mediaDefinition
=
$this
->
getMediaDefinition
(
[
new
ManyToManyAssociationField
(
'galleries',
'MediaGallery',
'MediaGalleryMapping',
'media_id',
'gallery_id',
)
,
]
)
,
'MediaGallery' =>
$this
->
getMediaGalleryDefinition
(
)
,
'MediaGalleryMapping' =>
$this
->
getMediaGalleryMappingDefinition
(
)
,
]
)
;
$id1
= Uuid::
randomHex
(
)
;
$id2
= Uuid::
randomHex
(
)
;
$media1
=
$this
->
createMedia
(
$id1
)
;
$media2
=
$this
->
createMedia
(
$id2
)
;
/** @var StaticEntityRepository<MediaCollection> $repo */
$repo
=
new
StaticEntityRepository
(
[