diff --git a/controllers/history.php b/controllers/history.php index 7febdf4..f75ab08 100644 --- a/controllers/history.php +++ b/controllers/history.php @@ -11,7 +11,7 @@ Router\get_action('history', function() { $offset = Request\int_param('offset', 0); $nb_items = Model\Item\count_by_status('read'); - $items = Model\Item\get_all( + $items = Model\Item\get_all_by_status( 'read', $offset, Model\Config\get('items_per_page'), diff --git a/controllers/item.php b/controllers/item.php index 4c25a30..b3f4730 100644 --- a/controllers/item.php +++ b/controllers/item.php @@ -15,7 +15,7 @@ Router\get_action('unread', function() { $order = Request\param('order', 'updated'); $direction = Request\param('direction', Model\Config\get('items_sorting_direction')); $offset = Request\int_param('offset', 0); - $items = Model\Item\get_all('unread', $offset, Model\Config\get('items_per_page'), $order, $direction); + $items = Model\Item\get_all_by_status('unread', $offset, Model\Config\get('items_per_page'), $order, $direction); $nb_items = Model\Item\count_by_status('unread'); if ($nb_items === 0) { diff --git a/jsonrpc.php b/jsonrpc.php index 3fa3fa9..9924b37 100644 --- a/jsonrpc.php +++ b/jsonrpc.php @@ -115,7 +115,7 @@ $server->register('item.bookmark.delete', function ($item_id) { // Get all unread items $server->register('item.list_unread', function ($offset = null, $limit = null) { - return Model\Item\get_all('unread', $offset, $limit); + return Model\Item\get_all_by_status('unread', $offset, $limit); }); // Count all unread items @@ -127,7 +127,7 @@ $server->register('item.count_unread', function () { // Get all read items $server->register('item.list_read', function ($offset = null, $limit = null) { - return Model\Item\get_all('read', $offset, $limit); + return Model\Item\get_all_by_status('read', $offset, $limit); }); // Count all read items @@ -181,13 +181,13 @@ $server->register('item.mark_all_as_read', function() { // Get all items with the content $server->register('item.get_all', function() { - return Model\Item\get_everything(); + return Model\Item\get_all(); }); // Get all items since a date $server->register('item.get_all_since', function($timestamp) { - return Model\Item\get_everything_since($timestamp); + return Model\Item\get_all_since($timestamp); }); // Get all items id and status diff --git a/models/item.php b/models/item.php index 8597c43..7e4e07a 100644 --- a/models/item.php +++ b/models/item.php @@ -10,7 +10,7 @@ use PicoFeed\Client\Grabber; use PicoFeed\Filter\Filter; // Get all items without filtering -function get_everything() +function get_all() { return Database::get('db') ->table('items') @@ -37,7 +37,7 @@ function get_everything() } // Get everthing since date (timestamp) -function get_everything_since($timestamp) +function get_all_since($timestamp) { return Database::get('db') ->table('items') @@ -90,7 +90,7 @@ function get_all_status() } // Get all items by status -function get_all($status, $offset = null, $limit = null, $order_column = 'updated', $order_direction = 'desc') +function get_all_by_status($status, $offset = null, $limit = null, $order_column = 'updated', $order_direction = 'desc') { return Database::get('db') ->table('items')