miniflux-legacy/app/models/item_group.php

30 lines
666 B
PHP
Raw Normal View History

2016-08-19 04:08:29 +02:00
<?php
namespace Model\ItemGroup;
use PicoDb\Database;
use Model\Group;
function mark_all_as_read($group_id)
{
$feed_ids = Group\get_feeds_by_group($group_id);
return Database::getInstance('db')
->table('items')
->eq('status', 'unread')
->in('feed_id', $feed_ids)
->update(array('status' => 'read'));
}
function mark_all_as_removed($group_id)
{
$feed_ids = Group\get_feeds_by_group($group_id);
return Database::getInstance('db')
->table('items')
->eq('status', 'read')
->eq('bookmark', 0)
->in('feed_id', $feed_ids)
->save(array('status' => 'removed', 'content' => ''));
}