You are here

function history_attach_timestamp in Drupal 8

#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 A renderable array containing the last read timestamp.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\history\HistoryRenderCallback::lazyBuilder() instead.

See also

https://www.drupal.org/node/2966725

1 call to history_attach_timestamp()
HistoryLegacyTest::testHistoryAttachTimestamp in core/modules/history/tests/src/Kernel/HistoryLegacyTest.php
Tests history_attach_timestamp() deprecation.

File

core/modules/history/history.module, line 198
Records which users have read which content.

Code

function history_attach_timestamp($node_id) {
  @trigger_error('history_attach_timestamp() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \\Drupal\\history\\HistoryRenderCallback::lazyBuilder() instead. See https://www.drupal.org/node/2966725', E_USER_DEPRECATED);
  return HistoryRenderCallback::lazyBuilder($node_id);
}