Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MaintenancePageLoadedEvent example
$page
= MaintenancePage::
createFrom
(
$page
)
;
/** @var CmsPageCollection $pages */
$pages
=
$this
->cmsPageLoader->
load
(
$request
,
new
Criteria
(
[
$cmsErrorLayoutId
]
)
,
$context
)
->
getEntities
(
)
;
if
(
!
$pages
->
has
(
$cmsErrorLayoutId
)
)
{
throw
new
PageNotFoundException
(
$cmsErrorLayoutId
)
;
}
$page
->
setCmsPage
(
$pages
->
get
(
$cmsErrorLayoutId
)
)
;
$this
->eventDispatcher->
dispatch
(
new
MaintenancePageLoadedEvent
(
$page
,
$context
,
$request
)
)
;
return
$page
;
}
catch
(
\Exception
)
{
throw
new
PageNotFoundException
(
$cmsErrorLayoutId
)
;
}
}
}