Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getHomeCmsPageId example
if
(
(
$category
->
getType
(
)
=== CategoryDefinition::TYPE_FOLDER
||
$category
->
getType
(
)
=== CategoryDefinition::TYPE_LINK
)
&&
$context
->
getSalesChannel
(
)
->
getNavigationCategoryId
(
)
!==
$navigationId
)
{
throw
CategoryException::
categoryNotFound
(
$navigationId
)
;
}
$pageId
=
$category
->
getCmsPageId
(
)
;
$slotConfig
=
$category
->
getTranslation
(
'slotConfig'
)
;
$salesChannel
=
$context
->
getSalesChannel
(
)
;
if
(
$category
->
getId
(
)
===
$salesChannel
->
getNavigationCategoryId
(
)
&&
$salesChannel
->
getHomeCmsPageId
(
)
)
{
$pageId
=
$salesChannel
->
getHomeCmsPageId
(
)
;
$slotConfig
=
$salesChannel
->
getTranslation
(
'homeSlotConfig'
)
;
}
if
(
!
$pageId
)
{
return
new
CategoryRouteResponse
(
$category
)
;
}
$resolverContext
=
new
EntityResolverContext
(
$context
,
$request
,
$this
->categoryDefinition,
$category
)
;
$pages
=
$this
->cmsPageLoader->
load
(