Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
prepareTagAssociatedData example
else
{
// New Data
$blogModel
=
new
Blog
(
)
;
}
// Setting the date in this way cause ext js got no datetime field
$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
(
)
;