Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Album example
AbstractQuery::HYDRATE_OBJECT
)
;
if
(
!
$album
instanceof Album
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false, 'message' => 'Invalid album id passed'
]
)
;
return
;
}
}
if
(
!
$album
instanceof Album
)
{
$album
=
new
Album
(
)
;
$this
->
getManager
(
)
->
persist
(
$album
)
;
}
try
{
$data
=
$this
->
resolveAlbumData
(
$data
,
$album
)
;
$album
->
fromArray
(
$data
)
;
$this
->
getManager
(
)
->
flush
(
$album
)
;
$this
->
getManager
(
)
->
flush
(
$album
->
getSettings
(
)
)
;
$this
->
View
(
)
->
assign
(
[
'success' => true, 'data' =>
[
'id' =>
$album
->
getId
(
)
]
]
)
;
}