Add last_modified to board/stack database and add check on index methods

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-10-27 15:56:07 +02:00
parent 38bc02c07e
commit a068d6e1c6
12 changed files with 113 additions and 60 deletions

View File

@@ -118,10 +118,10 @@ class CardMapper extends DeckMapper implements IPermissionMapper {
return $card;
}
public function findAll($stackId, $limit = null, $offset = null) {
public function findAll($stackId, $limit = null, $offset = null, $since = -1) {
$sql = 'SELECT * FROM `*PREFIX*deck_cards`
WHERE `stack_id` = ? AND NOT archived AND deleted_at = 0 ORDER BY `order`';
return $this->findEntities($sql, [$stackId], $limit, $offset);
WHERE `stack_id` = ? AND NOT archived AND deleted_at = 0 AND last_modified > ? ORDER BY `order`';
return $this->findEntities($sql, [$stackId, $since], $limit, $offset);
}
public function findDeleted($boardId, $limit = null, $offset = null) {