Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
history_write example
public
function
readNode
(
Request
$request
, NodeInterface
$node
)
{
if
(
$this
->
currentUser
(
)
->
isAnonymous
(
)
)
{
throw
new
AccessDeniedHttpException
(
)
;
}
// Update the history table, stating that this user viewed this node.
history_write
(
$node
->
id
(
)
)
;
return
new
JsonResponse
(
(int)
history_read
(
$node
->
id
(
)
)
)
;
}
}