Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
prepareAuthorAssociatedData example
$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
(
)
;
$repository
=
$this
->
getManager
(
)
->
getRepository
(
Blog::
class
)
;