rename functions to match their purpose
Item\get_all() -> Item\get_all_by_status() Item\get_everything() -> Item\get_all() Item\get_everything_since() -> Item\get_all_since()
This commit is contained in:
parent
f002723654
commit
9f21a2fe91
@ -11,7 +11,7 @@ Router\get_action('history', function() {
|
|||||||
|
|
||||||
$offset = Request\int_param('offset', 0);
|
$offset = Request\int_param('offset', 0);
|
||||||
$nb_items = Model\Item\count_by_status('read');
|
$nb_items = Model\Item\count_by_status('read');
|
||||||
$items = Model\Item\get_all(
|
$items = Model\Item\get_all_by_status(
|
||||||
'read',
|
'read',
|
||||||
$offset,
|
$offset,
|
||||||
Model\Config\get('items_per_page'),
|
Model\Config\get('items_per_page'),
|
||||||
|
@ -15,7 +15,7 @@ Router\get_action('unread', function() {
|
|||||||
$order = Request\param('order', 'updated');
|
$order = Request\param('order', 'updated');
|
||||||
$direction = Request\param('direction', Model\Config\get('items_sorting_direction'));
|
$direction = Request\param('direction', Model\Config\get('items_sorting_direction'));
|
||||||
$offset = Request\int_param('offset', 0);
|
$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');
|
$nb_items = Model\Item\count_by_status('unread');
|
||||||
|
|
||||||
if ($nb_items === 0) {
|
if ($nb_items === 0) {
|
||||||
|
@ -115,7 +115,7 @@ $server->register('item.bookmark.delete', function ($item_id) {
|
|||||||
// Get all unread items
|
// Get all unread items
|
||||||
$server->register('item.list_unread', function ($offset = null, $limit = null) {
|
$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
|
// Count all unread items
|
||||||
@ -127,7 +127,7 @@ $server->register('item.count_unread', function () {
|
|||||||
// Get all read items
|
// Get all read items
|
||||||
$server->register('item.list_read', function ($offset = null, $limit = null) {
|
$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
|
// Count all read items
|
||||||
@ -181,13 +181,13 @@ $server->register('item.mark_all_as_read', function() {
|
|||||||
// Get all items with the content
|
// Get all items with the content
|
||||||
$server->register('item.get_all', function() {
|
$server->register('item.get_all', function() {
|
||||||
|
|
||||||
return Model\Item\get_everything();
|
return Model\Item\get_all();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get all items since a date
|
// Get all items since a date
|
||||||
$server->register('item.get_all_since', function($timestamp) {
|
$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
|
// Get all items id and status
|
||||||
|
@ -10,7 +10,7 @@ use PicoFeed\Client\Grabber;
|
|||||||
use PicoFeed\Filter\Filter;
|
use PicoFeed\Filter\Filter;
|
||||||
|
|
||||||
// Get all items without filtering
|
// Get all items without filtering
|
||||||
function get_everything()
|
function get_all()
|
||||||
{
|
{
|
||||||
return Database::get('db')
|
return Database::get('db')
|
||||||
->table('items')
|
->table('items')
|
||||||
@ -37,7 +37,7 @@ function get_everything()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get everthing since date (timestamp)
|
// Get everthing since date (timestamp)
|
||||||
function get_everything_since($timestamp)
|
function get_all_since($timestamp)
|
||||||
{
|
{
|
||||||
return Database::get('db')
|
return Database::get('db')
|
||||||
->table('items')
|
->table('items')
|
||||||
@ -90,7 +90,7 @@ function get_all_status()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all items by 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')
|
return Database::get('db')
|
||||||
->table('items')
|
->table('items')
|
||||||
|
Loading…
Reference in New Issue
Block a user