Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Site example
$site
=
$this
->
getSiteRepository
(
)
->
find
(
$siteId
)
;
if
(
!
$site
instanceof Site
)
{
throw
new
ModelNotFoundException
(
Site::
class
,
$siteId
)
;
}
}
else
{
if
(
!
$this
->
_isAllowed
(
'createSite', 'site'
)
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false, 'message' => 'Permission denied.'
]
)
;
return
;
}
$site
=
new
Site
(
)
;
}
$site
->
fromArray
(
$params
)
;
$site
->
setChanged
(
)
;
$this
->
getManager
(
)
->
persist
(
$site
)
;
$this
->
getManager
(
)
->
flush
(
)
;
$data
=
$this
->
getSiteRepository
(
)
->
getSiteQuery
(
$site
->
getId
(
)
)