* - "block": The block rule; any article which matches this rule are hidden
* - "block": The block rule; any article which matches this rule are hidden
*/
*/
public function feedRulesGet(int $feedID): Db\Result {
public function feedRulesGet(int $feedID): Db\Result {
return $this->db->prepare("SELECT owner, keep_rule as keep, block_rule as block from arsse_subscriptions where feed = ? and (coalesce(keep_rule, '') || coalesce(block_rule, '')) <> ''", "int")->run($feedID);
return $this->db->prepare("SELECT owner, coalesce(keep_rule, '') as keep, coalesce(block_rule, '') as block from arsse_subscriptions where feed = ? and (keep || block) <> '' order by owner", "int")->run($feedID);
}
}
/** Retrieves various identifiers for the latest $count articles in the given newsfeed. The identifiers are:
/** Retrieves various identifiers for the latest $count articles in the given newsfeed. The identifiers are:
$this->assertResult([['id' => 1]], Arsse::$db->feedMatchIds(1, ['e433653cef2e572eee4215fa299a4a5af9137b2cefd6283c85bd69a32915beda'])); // this ID appears in both feed 1 and feed 2; only one result should be returned
$this->assertResult([['id' => 1]], Arsse::$db->feedMatchIds(1, ['e433653cef2e572eee4215fa299a4a5af9137b2cefd6283c85bd69a32915beda'])); // this ID appears in both feed 1 and feed 2; only one result should be returned
}
}
/** @dataProvider provideFilterRules */
public function testGetRules(int $in, array $exp): void {