
| Current Path : /var/www/html1/bebop-gmuend.de1/core/modules/history/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/bebop-gmuend.de1/core/modules/history/src/HistoryRenderCallback.php |
<?php
namespace Drupal\history;
use Drupal\Core\Render\Element\RenderCallbackInterface;
/**
* Render callback object.
*/
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;
}
}