diff options
author | Marco Nassabain <marco.nassabain@hotmail.com> | 2021-02-28 23:17:07 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 22:31:21 +0200 |
commit | af02560363bfc3942978f4650140672079f54701 (patch) | |
tree | aeb0d8a59870363c4841226ec45e46cba575a265 /lib/Db | |
parent | 8de50d44b6239dd54aef6080b4e5b9728cdbd9e7 (diff) |
🎨 ItemMapperV2: add new offset code (findShared)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Db')
-rw-r--r-- | lib/Db/ItemMapperV2.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php index 5399272ce..c283ca4fd 100644 --- a/lib/Db/ItemMapperV2.php +++ b/lib/Db/ItemMapperV2.php @@ -627,7 +627,6 @@ class ItemMapperV2 extends NewsMapperV2 ->andWhere('items.shared_with = :sharedWith') ->setParameter('sharedWith', $userId) ->setMaxResults($limit) - ->setFirstResult($offset) ->orderBy('items.last_modified', ($oldestFirst ? 'ASC' : 'DESC')) ->addOrderBy('items.id', ($oldestFirst ? 'ASC' : 'DESC')); @@ -639,6 +638,11 @@ class ItemMapperV2 extends NewsMapperV2 } } + if ($offset !== 0) { + $builder->andWhere($this->offsetWhere($oldestFirst)) + ->setParameter('offset', $offset); + } + if ($hideRead === true) { $builder->andWhere('items.unread = 1'); } |