1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-12-21 23:08:56 -05:00

[fix] getEntryById now returns an array with one element

This commit is contained in:
Nicolas Lœuillet 2014-01-09 09:56:46 +01:00
parent dddb6809eb
commit bbd89215d8
2 changed files with 2 additions and 2 deletions
app/controllers
src/Poche/Repository

View File

@ -15,7 +15,7 @@ $front->get('/view/{id}', function (Request $request, $id) use ($app) {
$entry = $app['entry_api']->getEntryById($id); $entry = $app['entry_api']->getEntryById($id);
return $app['twig']->render('view.twig', array('entry' => $entry)); return $app['twig']->render('view.twig', array('entry' => $entry[0]));
}) })
->bind('view_entry'); ->bind('view_entry');

View File

@ -29,7 +29,7 @@ class EntryRepository
$sql = "SELECT * FROM entries where id = ? AND user_id = ?"; $sql = "SELECT * FROM entries where id = ? AND user_id = ?";
$entry = $this->db->fetchAll($sql, array($id, $userId)); $entry = $this->db->fetchAll($sql, array($id, $userId));
return $entry ? $entry[0] : array(); return $entry ? $entry : array();
} }
} }