class HistoryRenderCallback
Render callback object.
Hierarchy
- class \Drupal\history\HistoryRenderCallback implements \Drupal\Core\Render\Element\RenderCallbackInterface
Expanded class hierarchy of HistoryRenderCallback
1 file declares its use of HistoryRenderCallback
- history.module in core/modules/ history/ history.module 
- Records which users have read which content.
File
- 
              core/modules/ history/ src/ HistoryRenderCallback.php, line 10 
Namespace
Drupal\historyView source
class HistoryRenderCallback implements RenderCallbackInterface {
  
  /**
   * #lazy_builder callback; attaches the last read timestamp for a node.
   *
   * @param int $node_id
   *   The node ID for which to attach the last read timestamp.
   *
   * @return array
   *   A renderable array containing the last read timestamp.
   */
  public static function lazyBuilder($node_id) {
    $element = [];
    $element['#attached']['drupalSettings']['history']['lastReadTimestamps'][$node_id] = (int) history_read($node_id);
    return $element;
  }
}Members
| Title Sort descending | Modifiers | Object type | Summary | 
|---|---|---|---|
| HistoryRenderCallback::lazyBuilder | public static | function | #lazy_builder callback; attaches the last read timestamp for a node. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
