diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-09-29 13:54:17 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-29 14:56:07 +0200 |
commit | 35b53ecd404a74edea3c6866e451c4819bdc9ea8 (patch) | |
tree | dac46834d8fa7ec0122243f94604c3d2215b4d22 /lib/Db/ItemMapperV2.php | |
parent | d6d169be15913404f99b86c39a03bc71942c9f77 (diff) |
OPML export command and fixes
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Db/ItemMapperV2.php')
-rw-r--r-- | lib/Db/ItemMapperV2.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php index ba840fda7..edb8ba55f 100644 --- a/lib/Db/ItemMapperV2.php +++ b/lib/Db/ItemMapperV2.php @@ -43,10 +43,11 @@ class ItemMapperV2 extends NewsMapperV2 * Find all feeds for a user. * * @param string $userId The user identifier + * @param array $params Filter parameters * * @return Entity[] */ - public function findAllFromUser($userId): array + public function findAllFromUser(string $userId, array $params = []): array { $builder = $this->db->getQueryBuilder(); $builder->select('items.*') @@ -56,6 +57,11 @@ class ItemMapperV2 extends NewsMapperV2 ->andWhere('deleted_at = 0') ->setParameter(':user_id', $userId, IQueryBuilder::PARAM_STR); + foreach ($params as $key => $value) { + $builder->andWhere("${key} = :${key}") + ->setParameter(":${key}", $value); + } + return $this->findEntities($builder); } @@ -110,7 +116,7 @@ class ItemMapperV2 extends NewsMapperV2 * * @param int $threshold Deletion threshold */ - public function deleteOverThreshold($threshold) + public function deleteOverThreshold(int $threshold) { $builder = $this->db->getQueryBuilder(); |