function HistoryController::getNodeReadTimestamps
Same name in other branches
- 8.9.x core/modules/history/src/Controller/HistoryController.php \Drupal\history\Controller\HistoryController::getNodeReadTimestamps()
- 10 core/modules/history/src/Controller/HistoryController.php \Drupal\history\Controller\HistoryController::getNodeReadTimestamps()
- 11.x core/modules/history/src/Controller/HistoryController.php \Drupal\history\Controller\HistoryController::getNodeReadTimestamps()
Returns a set of nodes' last read timestamps.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request of the page.
Return value
Symfony\Component\HttpFoundation\JsonResponse The JSON response.
1 string reference to 'HistoryController::getNodeReadTimestamps'
- history.routing.yml in core/
modules/ history/ history.routing.yml - core/modules/history/history.routing.yml
File
-
core/
modules/ history/ src/ Controller/ HistoryController.php, line 26
Class
- HistoryController
- Returns responses for History module routes.
Namespace
Drupal\history\ControllerCode
public function getNodeReadTimestamps(Request $request) {
if ($this->currentUser()
->isAnonymous()) {
throw new AccessDeniedHttpException();
}
$nids = $request->request
->get('node_ids');
if (!isset($nids)) {
throw new NotFoundHttpException();
}
return new JsonResponse(history_read_multiple($nids));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.