82df35a59b
This is a major change for the next release of Miniflux. - There is now only one database that can supports multiple users - There is no automated schema migration for this release - A migration procedure is available in the ChangeLog file
29 lines
646 B
PHP
29 lines
646 B
PHP
<?php
|
|
|
|
namespace Miniflux\Model\ItemGroup;
|
|
|
|
use Miniflux\Model\Item;
|
|
use Miniflux\Model\Group;
|
|
use PicoDb\Database;
|
|
|
|
function change_items_status($user_id, $group_id, $current_status, $new_status, $before = null)
|
|
{
|
|
$feed_ids = Group\get_feed_ids_by_group($group_id);
|
|
|
|
if (empty($feed_ids)) {
|
|
return false;
|
|
}
|
|
|
|
$query = Database::getInstance('db')
|
|
->table(Item\TABLE)
|
|
->eq('user_id', $user_id)
|
|
->eq('status', $current_status)
|
|
->in('feed_id', $feed_ids);
|
|
|
|
if ($before !== null) {
|
|
$query->lte('updated', $before);
|
|
}
|
|
|
|
return $query->update(array('status' => $new_status));
|
|
}
|