Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
updateAssociations example
// Create default thumbnails
$this
->
createDefaultThumbnails
(
)
;
}
// Remove the configured album thumbnail files
$settings
=
$album
->
getSettings
(
)
;
if
(
$settings
!== null
)
{
$this
->
removeAlbumThumbnails
(
$settings
->
getThumbnailSize
(
)
,
$name
)
;
}
$this
->
updateAssociations
(
)
;
// Create album thumbnails
$this
->
createAlbumThumbnails
(
$this
->album
)
;
}
// Name changed? Then rename the file and set the new path
if
(
$isNameChanged
)
{
$mediaService
=
Shopware
(
)
->
Container
(
)
->
get
(
MediaServiceInterface::
class
)
;
$newName
=
$this
->
getFileName
(
)
;
$newPath
=
$this
->
getUploadDir
(
)
.
$newName
;