From b6d53befa4463474a4df28d758cbfe7a2e9b68f2 Mon Sep 17 00:00:00 2001 From: Benjamin Vison Date: Mon, 23 Jul 2018 23:11:42 -0400 Subject: [PATCH] Added the _total_count field so the client knows if there are more items to sync in the section --- Entity/SyncState.php | 1 + Service/SyncService.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Entity/SyncState.php b/Entity/SyncState.php index 1e47788..e7999ec 100755 --- a/Entity/SyncState.php +++ b/Entity/SyncState.php @@ -13,6 +13,7 @@ class SyncState { const REAL_LAST_TIMESTAMP = "_real_last_timestamp"; + const TOTAL_COUNT = "_total_count"; /** * @var int * diff --git a/Service/SyncService.php b/Service/SyncService.php index 5326367..bf3542f 100755 --- a/Service/SyncService.php +++ b/Service/SyncService.php @@ -80,6 +80,7 @@ public function getFromMappings($mappings) { 'newItems' => json_decode($this->container->get('jms_serializer')->serialize($newItems, 'json'), true), 'failedItems' => json_decode($this->container->get('jms_serializer')->serialize($failedItems, 'json'), true), SyncState::REAL_LAST_TIMESTAMP => $result[SyncState::REAL_LAST_TIMESTAMP], + SyncState::TOTAL_COUNT => $result[SyncState::TOTAL_COUNT], ); }