Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
prepareMediaDataForSaving example
$params
[
'displayDate'
]
=
$params
[
'displayDate'
]
. ' ' .
$params
[
'displayTime'
]
;
if
(
!
$params
[
'shopIds'
]
)
{
$params
[
'shopIds'
]
= null;
}
$this
->
prepareTagAssociatedData
(
$params
,
$blogModel
)
;
$params
=
$this
->
prepareAssignedArticlesAssociatedData
(
$params
)
;
$params
=
$this
->
prepareAuthorAssociatedData
(
$params
)
;
unset
(
$params
[
'tags'
]
)
;
$params
[
'media'
]
=
$this
->
prepareMediaDataForSaving
(
$params
[
'media'
]
)
;
$blogModel
->
fromArray
(
$params
)
;
try
{
$this
->
getManager
(
)
->
persist
(
$blogModel
)
;
$this
->
getManager
(
)
->
flush
(
)
;
$repository
=
$this
->
getManager
(
)
->
getRepository
(
Blog::
class
)
;
$filter
=
[
[
'property' => 'id', 'value' =>
$blogModel
->
getId
(
)
]
]
;
$dataQuery
=
$repository
->
getBackendDetailQuery
(
$filter
)
;