Issue #1987196 by klausi: Simplify dblog REST resource.

8.0.x
Alex Pott 2013-05-12 18:50:04 +01:00
parent a858b3473c
commit f0aee215cd
1 changed files with 2 additions and 2 deletions

View File

@ -48,9 +48,9 @@ class DBLogResource extends ResourceBase {
public function get($id = NULL) { public function get($id = NULL) {
if ($id) { if ($id) {
$record = db_query("SELECT * FROM {watchdog} WHERE wid = :wid", array(':wid' => $id)) $record = db_query("SELECT * FROM {watchdog} WHERE wid = :wid", array(':wid' => $id))
->fetchObject(); ->fetchAssoc();
if (!empty($record)) { if (!empty($record)) {
return new ResourceResponse((array) $record); return new ResourceResponse($record);
} }
} }
throw new NotFoundHttpException(t('Log entry with ID @id was not found', array('@id' => $id))); throw new NotFoundHttpException(t('Log entry with ID @id was not found', array('@id' => $id)));