Responds to GET requests.
Returns a watchdog log entry for the specified ID.
\Drupal\rest\ResourceResponse The response containing the log entry.
\Symfony\Component\HttpKernel\Exception\HttpException
public function get($id = NULL) {
if ($id) {
$record = db_query("SELECT * FROM {watchdog} WHERE wid = :wid", array(
':wid' => $id,
))
->fetchAssoc();
if (!empty($record)) {
return new ResourceResponse($record);
}
}
throw new NotFoundHttpException(t('Log entry with ID @id was not found', array(
'@id' => $id,
)));
}