mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Make notes soft-deletable
This commit is contained in:
parent
2fdc8a540c
commit
a032ba09d2
1 changed files with 2 additions and 2 deletions
|
@ -29,12 +29,12 @@ class Notes
|
|||
function getUserNotes(User $user, int $page = 1, ?int $perPage = NULL): \Traversable
|
||||
{
|
||||
$perPage = $perPage ?? OPENVK_DEFAULT_PER_PAGE;
|
||||
foreach($this->notes->where("owner", $user->getId())->page($page, $perPage) as $album)
|
||||
foreach($this->notes->where("owner", $user->getId())->where("deleted", 0)->page($page, $perPage) as $album)
|
||||
yield new Note($album);
|
||||
}
|
||||
|
||||
function getUserNotesCount(User $user): int
|
||||
{
|
||||
return sizeof($this->notes->where("owner", $user->getId()));
|
||||
return sizeof($this->notes->where("owner", $user->getId())->where("deleted", 0));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue