Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getIsLandingPage example
$emotion
=
$this
->
get
(
'models'
)
->
find
(
Emotion::
class
,
$emotionId
)
;
if
(
!
$emotion
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false
]
)
;
return
;
}
$new
=
clone
$emotion
;
switch
(
true
)
{
case
$emotion
->
getIsLandingPage
(
)
&&
$emotion
->
getParentId
(
)
:
$new
->
setParentId
(
$emotion
->
getParentId
(
)
)
;
break
;
case
$emotion
->
getIsLandingPage
(
)
:
$new
->
setParentId
(
$emotion
->
getId
(
)
)
;
break
;
}
$copyName
=
$emotion
->
getName
(
)
. ' - Copy';
$new
->
setName
(
$copyName
)
;
$new
->
setDevice
(
$device
)
;