function history_attach_timestamp in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/history/history.module \history_attach_timestamp()
#lazy_builder callback; attaches the last read timestamp for a node.
Parameters
int $node_id: The node ID for which to attach the last read timestamp.
Return value
array $element A renderable array containing the last read timestamp.
1 string reference to 'history_attach_timestamp'
- CommentViewBuilder::buildComponents in core/
modules/ comment/ src/ CommentViewBuilder.php - In addition to modifying the content key on entities, this implementation will also set the comment entity key which all comments carry.
File
- core/
modules/ history/ history.module, line 190 - Records which users have read which content.
Code
function history_attach_timestamp($node_id) {
$element = [];
$element['#attached']['drupalSettings']['history']['lastReadTimestamps'][$node_id] = (int) history_read($node_id);
return $element;
}