Add API method to remove all feeds

This commit is contained in:
Frédéric Guillot 2013-08-28 18:17:16 -04:00
parent 51a746fac0
commit e0bbaaa3b5
2 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,12 @@ $server->register('feed.delete', function($feed_id) {
return Model\remove_feed($feed_id);
});
// Delete all feeds
$server->register('feed.delete_all', function() {
return Model\remove_feeds();
});
// Enable a feed
$server->register('feed.enable', function($feed_id) {

View File

@ -390,6 +390,12 @@ function remove_feed($feed_id)
}
function remove_feeds()
{
return \PicoTools\singleton('db')->table('feeds')->remove();
}
function enable_feed($feed_id)
{
return \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save((array('enabled' => 1)));