Add the method "item.set_list_status" to the API
This commit is contained in:
parent
bf0de86b8a
commit
51a746fac0
@ -24,7 +24,7 @@ print_r($result);
|
||||
$result = $client->execute('feed.delete', array('feed_id' => $feed_id));
|
||||
var_dump($result);
|
||||
|
||||
$result = $client->execute('item.list_unread');
|
||||
$result = $client->execute('item.list_read');
|
||||
print_r($result);
|
||||
|
||||
$result = $client->execute('item.list_unread', array('offset' => 5, 'limit' => 2));
|
||||
@ -37,4 +37,6 @@ if (count($result)) {
|
||||
}
|
||||
|
||||
$result = $client->execute('item.bookmark.list');
|
||||
print_r($result);
|
||||
print_r($result);
|
||||
|
||||
var_dump($client->execute('item.set_list_status', array('status' => 'read', 'items' => array('57cdb841', '8ef6744e'))));
|
||||
|
@ -139,6 +139,12 @@ $server->register('item.mark_as_unread', function($item_id) {
|
||||
return Model\set_item_unread($item_id);
|
||||
});
|
||||
|
||||
// Change the status of list of items
|
||||
$server->register('item.set_list_status', function($status, array $items) {
|
||||
|
||||
return Model\set_items_status($status, $items);
|
||||
});
|
||||
|
||||
// Flush all read items
|
||||
$server->register('item.flush', function() {
|
||||
|
||||
|
11
model.php
11
model.php
@ -602,6 +602,17 @@ function set_item_unread($id)
|
||||
}
|
||||
|
||||
|
||||
function set_items_status($status, array $items)
|
||||
{
|
||||
if (! in_array($status, array('read', 'unread', 'removed'))) return false;
|
||||
|
||||
return \PicoTools\singleton('db')
|
||||
->table('items')
|
||||
->in('id', $items)
|
||||
->save(array('status' => $status));
|
||||
}
|
||||
|
||||
|
||||
function set_bookmark_value($id, $value)
|
||||
{
|
||||
return \PicoTools\singleton('db')
|
||||
|
Loading…
Reference in New Issue
Block a user