Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
_keyFromId example
if
(
!
$tags
|| !
count
(
$tags
)
)
{
$tags
=
[
''
]
;
}
if
(
is_string
(
$tags
)
)
{
$tags
=
[
$tags
]
;
}
if
(
!
count
(
$tags
)
)
{
$this
->_redis->
del
(
$this
->
_keyFromItemTags
(
$id
)
)
;
if
(
$lifetime
=== null
)
{
$return
=
$this
->_redis->
set
(
$this
->
_keyFromId
(
$id
)
,
$data
)
;
}
else
{
$return
=
$this
->_redis->
setex
(
$this
->
_keyFromId
(
$id
)
,
$lifetime
,
$data
)
;
}
$this
->_redis->
sAdd
(
$this
->
_keyFromItemTags
(
$id
)
, ''
)
;
if
(
$lifetime
!== null
)
{
$this
->_redis->
expire
(
$this
->
_keyFromItemTags
(
$id
)
,
$lifetime
)
;
}
else
{
$redis
=
$this
->_redis->
persist
(
$this
->
_keyFromItemTags
(
$id
)
)
;
}
return
$return
;
}