Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
LanguageRouteCacheKeyEvent example
return
CacheValueCompressor::
uncompress
(
$value
)
;
}
private
function
generateKey
(
Request
$request
, SalesChannelContext
$context
, Criteria
$criteria
)
: ?string
{
$parts
=
[
$this
->generator->
getCriteriaHash
(
$criteria
)
,
$this
->generator->
getSalesChannelContextHash
(
$context
)
,
]
;
$event
=
new
LanguageRouteCacheKeyEvent
(
$parts
,
$request
,
$context
,
$criteria
)
;
$this
->dispatcher->
dispatch
(
$event
)
;
if
(
!
$event
->
shouldCache
(
)
)
{
return
null;
}
return
self::
buildName
(
$context
->
getSalesChannelId
(
)
)
. '-' .
md5
(
Json::
encode
(
$event
->
getParts
(
)
)
)
;
}
/** * @return array<string> */