From bd42c8f79f67aa78a23804ca9aa911a705c01801 Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Wed, 10 Jan 2018 13:05:43 -0500 Subject: [PATCH 1/6] fixing documentation composer require command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b92854f..c9b83a8 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 1. Install the bundle using composer: ``` - $ composer require ntidev/sync-bundle "dev-master" + $ composer require nti/sync-bundle "dev-master" ``` 2. Add the bundle configuration to the AppKernel @@ -257,4 +257,4 @@ The server then returns the following structure: ## Todo -* Handle deletes from third parties \ No newline at end of file +* Handle deletes from third parties From db01aa96b81ab62a1737111eb069b522a81ecc95 Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Thu, 18 Jan 2018 16:12:06 -0500 Subject: [PATCH 2/6] backing up. --- Controller/SyncController.php | 2 +- Entity/SyncDeleteState.php | 1 - Entity/SyncMapping.php | 1 - Entity/SyncNewItemState.php | 2 +- Entity/SyncState.php | 1 - Service/SyncService.php | 7 ++++++- 6 files changed, 8 insertions(+), 6 deletions(-) mode change 100755 => 100644 Entity/SyncDeleteState.php mode change 100755 => 100644 Entity/SyncMapping.php mode change 100755 => 100644 Entity/SyncNewItemState.php mode change 100755 => 100644 Entity/SyncState.php diff --git a/Controller/SyncController.php b/Controller/SyncController.php index d64ec82..70747b9 100755 --- a/Controller/SyncController.php +++ b/Controller/SyncController.php @@ -98,7 +98,7 @@ public function pushAction(Request $request) { $syncClass = $mapping->getSyncService(); - if(!class_exists($syncClass)) { continue; } + #if(!class_exists($syncClass)) { continue; } /** @var SyncServiceInterface $service */ $service = $this->get($syncClass); diff --git a/Entity/SyncDeleteState.php b/Entity/SyncDeleteState.php old mode 100755 new mode 100644 index d7778d6..9a83c09 --- a/Entity/SyncDeleteState.php +++ b/Entity/SyncDeleteState.php @@ -108,4 +108,3 @@ public function setTimestamp($timestamp) } } - diff --git a/Entity/SyncMapping.php b/Entity/SyncMapping.php old mode 100755 new mode 100644 index 010e4c2..04ac4d2 --- a/Entity/SyncMapping.php +++ b/Entity/SyncMapping.php @@ -108,4 +108,3 @@ public function setSyncService($syncService) } - diff --git a/Entity/SyncNewItemState.php b/Entity/SyncNewItemState.php old mode 100755 new mode 100644 index 08d9d7f..e6e46fb --- a/Entity/SyncNewItemState.php +++ b/Entity/SyncNewItemState.php @@ -141,4 +141,4 @@ public function setTimestamp($timestamp) return $this; } -} \ No newline at end of file +} diff --git a/Entity/SyncState.php b/Entity/SyncState.php old mode 100755 new mode 100644 index 379fd71..1e47788 --- a/Entity/SyncState.php +++ b/Entity/SyncState.php @@ -83,4 +83,3 @@ public function setTimestamp($timestamp) } } - diff --git a/Service/SyncService.php b/Service/SyncService.php index 9be58a7..b628773 100755 --- a/Service/SyncService.php +++ b/Service/SyncService.php @@ -27,7 +27,6 @@ class SyncService { */ public function __construct(ContainerInterface $container) { $this->container = $container; - } /** @@ -61,6 +60,11 @@ public function getFromMappings($mappings) { $deletes = $this->em->getRepository('NTISyncBundle:SyncDeleteState')->findFromTimestamp($mappingName, $timestamp); $newItems = $this->em->getRepository('NTISyncBundle:SyncNewItemState')->findFromTimestampAndMapping($mappingName, $timestamp); + /** + * Failed Items Synchronization + */ + $failedItems = $this->em->getRepository('NTISyncBundle:SyncFailedItemState')->findFromTimestampAndMapping($mappingName, $timestamp); + /** @var SyncRepositoryInterface $repository */ $repository = $this->em->getRepository($syncMapping->getClass()); if(!($repository instanceof SyncRepositoryInterface)) { @@ -74,6 +78,7 @@ public function getFromMappings($mappings) { 'changes' => $result["data"], 'deletes' => json_decode($this->container->get('jms_serializer')->serialize($deletes, 'json'), true), '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], ); } From 8319fa14a830f39cf26bb807a4a9acb6aadee8b1 Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Fri, 19 Jan 2018 09:45:07 -0500 Subject: [PATCH 3/6] Added support for handle failed synchronization --- Entity/SyncDeleteState.php~ | 110 +++++++++++ Entity/SyncFailedItemState.php | 191 +++++++++++++++++++ Entity/SyncFailedItemState.php~ | 191 +++++++++++++++++++ Entity/SyncMapping.php~ | 110 +++++++++++ Entity/SyncNewItemState.php~ | 144 ++++++++++++++ Entity/SyncState.php~ | 85 +++++++++ README.md | 21 +- Repository/SyncFailedItemStateRepository.php | 41 ++++ 8 files changed, 891 insertions(+), 2 deletions(-) create mode 100644 Entity/SyncDeleteState.php~ create mode 100644 Entity/SyncFailedItemState.php create mode 100644 Entity/SyncFailedItemState.php~ create mode 100644 Entity/SyncMapping.php~ create mode 100644 Entity/SyncNewItemState.php~ create mode 100644 Entity/SyncState.php~ create mode 100755 Repository/SyncFailedItemStateRepository.php diff --git a/Entity/SyncDeleteState.php~ b/Entity/SyncDeleteState.php~ new file mode 100644 index 0000000..9a83c09 --- /dev/null +++ b/Entity/SyncDeleteState.php~ @@ -0,0 +1,110 @@ +id; + } + + /** + * @return SyncMapping + */ + public function getMapping() + { + return $this->mapping; + } + + /** + * @param SyncMapping $mapping + * @return SyncDeleteState + */ + public function setMapping($mapping) + { + $this->mapping = $mapping; + return $this; + } + + /** + * @return int + */ + public function getClassId() + { + return $this->classId; + } + + /** + * @param int $classId + * @return SyncDeleteState + */ + public function setClassId($classId) + { + $this->classId = $classId; + return $this; + } + + /** + * @return int + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param int $timestamp + * @return SyncDeleteState + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + return $this; + } + +} diff --git a/Entity/SyncFailedItemState.php b/Entity/SyncFailedItemState.php new file mode 100644 index 0000000..7088247 --- /dev/null +++ b/Entity/SyncFailedItemState.php @@ -0,0 +1,191 @@ +id; + } + + /** + * Set uuid + * + * @param string $uuid + * + * @return SyncFailedItemState + */ + public function setUuid($uuid) + { + $this->uuid = $uuid; + + return $this; + } + + /** + * Get uuid + * + * @return string + */ + public function getUuid() + { + return $this->uuid; + } + + /** + * Set classId + * + * @param integer $classId + * + * @return SyncFailedItemState + */ + public function setClassId($classId) + { + $this->classId = $classId; + + return $this; + } + + /** + * Get classId + * + * @return integer + */ + public function getClassId() + { + return $this->classId; + } + + /** + * Set timestamp + * + * @param integer $timestamp + * + * @return SyncFailedItemState + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + + /** + * Get timestamp + * + * @return integer + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * Set errors + * + * @param string $errors + * + * @return SyncFailedItemState + */ + public function setErrors($errors) + { + $this->errors = $errors; + + return $this; + } + + /** + * Get errors + * + * @return string + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Set mapping + * + * @param \NTI\SyncBundle\Entity\SyncMapping $mapping + * + * @return SyncFailedItemState + */ + public function setMapping(\NTI\SyncBundle\Entity\SyncMapping $mapping = null) + { + $this->mapping = $mapping; + + return $this; + } + + /** + * Get mapping + * + * @return \NTI\SyncBundle\Entity\SyncMapping + */ + public function getMapping() + { + return $this->mapping; + } +} diff --git a/Entity/SyncFailedItemState.php~ b/Entity/SyncFailedItemState.php~ new file mode 100644 index 0000000..7088247 --- /dev/null +++ b/Entity/SyncFailedItemState.php~ @@ -0,0 +1,191 @@ +id; + } + + /** + * Set uuid + * + * @param string $uuid + * + * @return SyncFailedItemState + */ + public function setUuid($uuid) + { + $this->uuid = $uuid; + + return $this; + } + + /** + * Get uuid + * + * @return string + */ + public function getUuid() + { + return $this->uuid; + } + + /** + * Set classId + * + * @param integer $classId + * + * @return SyncFailedItemState + */ + public function setClassId($classId) + { + $this->classId = $classId; + + return $this; + } + + /** + * Get classId + * + * @return integer + */ + public function getClassId() + { + return $this->classId; + } + + /** + * Set timestamp + * + * @param integer $timestamp + * + * @return SyncFailedItemState + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + + /** + * Get timestamp + * + * @return integer + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * Set errors + * + * @param string $errors + * + * @return SyncFailedItemState + */ + public function setErrors($errors) + { + $this->errors = $errors; + + return $this; + } + + /** + * Get errors + * + * @return string + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Set mapping + * + * @param \NTI\SyncBundle\Entity\SyncMapping $mapping + * + * @return SyncFailedItemState + */ + public function setMapping(\NTI\SyncBundle\Entity\SyncMapping $mapping = null) + { + $this->mapping = $mapping; + + return $this; + } + + /** + * Get mapping + * + * @return \NTI\SyncBundle\Entity\SyncMapping + */ + public function getMapping() + { + return $this->mapping; + } +} diff --git a/Entity/SyncMapping.php~ b/Entity/SyncMapping.php~ new file mode 100644 index 0000000..04ac4d2 --- /dev/null +++ b/Entity/SyncMapping.php~ @@ -0,0 +1,110 @@ +id; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + * @return SyncMapping + */ + public function setName($name) + { + $this->name = $name; + return $this; + } + + /** + * @return string + */ + public function getClass() + { + return $this->class; + } + + /** + * @param string $class + * @return SyncMapping + */ + public function setClass($class) + { + $this->class = $class; + return $this; + } + + /** + * @return string + */ + public function getSyncService() + { + return $this->syncService; + } + + /** + * @param string $syncService + * @return SyncMapping + */ + public function setSyncService($syncService) + { + $this->syncService = $syncService; + return $this; + } + + +} diff --git a/Entity/SyncNewItemState.php~ b/Entity/SyncNewItemState.php~ new file mode 100644 index 0000000..e6e46fb --- /dev/null +++ b/Entity/SyncNewItemState.php~ @@ -0,0 +1,144 @@ +id; + } + + /** + * @param int $id + * @return SyncNewItemState + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * @return string + */ + public function getUuid() + { + return $this->uuid; + } + + /** + * @param string $uuid + * @return SyncNewItemState + */ + public function setUuid($uuid) + { + $this->uuid = $uuid; + return $this; + } + + /** + * @return SyncMapping + */ + public function getMapping() + { + return $this->mapping; + } + + /** + * @param SyncMapping $mapping + * @return SyncNewItemState + */ + public function setMapping($mapping) + { + $this->mapping = $mapping; + return $this; + } + + /** + * @return int + */ + public function getClassId() + { + return $this->classId; + } + + /** + * @param int $classId + * @return SyncNewItemState + */ + public function setClassId($classId) + { + $this->classId = $classId; + return $this; + } + + /** + * @return int + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param int $timestamp + * @return SyncNewItemState + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + return $this; + } + +} diff --git a/Entity/SyncState.php~ b/Entity/SyncState.php~ new file mode 100644 index 0000000..1e47788 --- /dev/null +++ b/Entity/SyncState.php~ @@ -0,0 +1,85 @@ +id; + } + + /** + * @return SyncMapping + */ + public function getMapping() + { + return $this->mapping; + } + + /** + * @param SyncMapping $mapping + * @return SyncState + */ + public function setMapping($mapping) + { + $this->mapping = $mapping; + return $this; + } + + /** + * @return int + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param int $timestamp + * @return SyncState + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + return $this; + } + +} diff --git a/README.md b/README.md index c9b83a8..5f3238c 100755 --- a/README.md +++ b/README.md @@ -187,17 +187,34 @@ After receiving the request, if a mapping with the specified name exists, the sy }, ... ], + "failedItems": [ + { + "id": 7, + "uuid": "abcdefg-123456-hifgxyz-78901", + "mapping": { + "id": 9, + "name": "Product", + "class": "AppBundle\\Entity\\Product\\Product", + "sync_service": " ... " + }, + "classId": 137, + "timestamp": 1512080747, + "errors": "{"has_error":true,"additional_errors":null,"code":403,"message":"This inventory report is already closed. Further operations are not allowed.","data":null,"redirect":null}" + }, + ... + ], "_real_last_timestamp": 1512092445 } } ``` -The server will return the both the `changes` , `newItems`, and the `deletes`. The `changes` will contain the `data` portion of the array returned by +The server will return the both the `changes` , `newItems`, `failedItems` ,and the `deletes`. The `changes` will contain the `data` portion of the array returned by the repository's implementation of `SyncRepositoryInterface`. The `deletes` will contain the list of `SyncDeleteState` that were recorded since the specified timestamp. The `newItems` will contain the list of `SyncNewItemState` which means the new items that were created since the provided timestamp including the UUID that was given at the time (This is helpful to third party devices when first pulling the information they can verify if an item was already created -but they don't have the ID of that item in their local storage and avoid creating duplicates in the server) +but they don't have the ID of that item in their local storage and avoid creating duplicates in the server). The `failedItems` will contain the list of `SyncFailedItemState`, each item in this list +contains an `errors` JSON property with the list of errors founds processing the creation or update of the entity. The `_real_last_timestamp` should be used as it can help with paginating the results for a full-sync and help the client get the real last timestamp of the last object in the response. This has to be obtained in the repository and can be done diff --git a/Repository/SyncFailedItemStateRepository.php b/Repository/SyncFailedItemStateRepository.php new file mode 100755 index 0000000..da12c3e --- /dev/null +++ b/Repository/SyncFailedItemStateRepository.php @@ -0,0 +1,41 @@ +createQueryBuilder('s'); + $qb ->innerJoin('s.mapping', 'm') + ->andWhere('m.name = :mappingName') + ->setParameter('mappingName', $mappingName) + ->andWhere('s.timestamp >= :timestamp') + ->setParameter('timestamp', $timestamp) + ->orderBy('s.timestamp', 'asc'); + return $qb->getQuery()->getResult(); + } + + public function findByUuId($id){ + $qb = $this->getEntityManager()->createQueryBuilder(); + $qb->select('item') + ->from('NTISyncBundle:SyncFailedItemState', 'item') + ->andWhere( + $qb->expr()->eq('binary(item.uuid)', $qb->expr()->literal($id)) + ); + + try { + return $qb->getQuery()->getOneOrNullResult(); + }catch (NonUniqueResultException $e){ + return null; + } + } +} From ee627e448cbe8dee1f600862162a48a6f98e83bb Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Fri, 19 Jan 2018 10:31:44 -0500 Subject: [PATCH 4/6] Removing binary dependency --- Repository/SyncFailedItemStateRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Repository/SyncFailedItemStateRepository.php b/Repository/SyncFailedItemStateRepository.php index da12c3e..e114b5c 100755 --- a/Repository/SyncFailedItemStateRepository.php +++ b/Repository/SyncFailedItemStateRepository.php @@ -29,7 +29,7 @@ public function findByUuId($id){ $qb->select('item') ->from('NTISyncBundle:SyncFailedItemState', 'item') ->andWhere( - $qb->expr()->eq('binary(item.uuid)', $qb->expr()->literal($id)) + $qb->expr()->eq('item.uuid', $qb->expr()->literal($id)) ); try { From 6ec4c4163add71337d4c899336d81c6398feba00 Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Wed, 24 Jan 2018 10:19:17 -0500 Subject: [PATCH 5/6] adding .gitignore file --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..3a2a5ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# composer +/composer.phar + +# Backup entities generated with doctrine:generate:entities command +**/Entity/*~ + From c9daa55ccf196ee7a15499be85365244a76bc297 Mon Sep 17 00:00:00 2001 From: Enercido Alcantara Date: Wed, 24 Jan 2018 10:38:15 -0500 Subject: [PATCH 6/6] ignoring ~ --- Entity/SyncDeleteState.php~ | 110 ------------------ Entity/SyncFailedItemState.php~ | 191 -------------------------------- Entity/SyncMapping.php~ | 110 ------------------ Entity/SyncNewItemState.php~ | 144 ------------------------ Entity/SyncState.php~ | 85 -------------- 5 files changed, 640 deletions(-) delete mode 100644 Entity/SyncDeleteState.php~ delete mode 100644 Entity/SyncFailedItemState.php~ delete mode 100644 Entity/SyncMapping.php~ delete mode 100644 Entity/SyncNewItemState.php~ delete mode 100644 Entity/SyncState.php~ diff --git a/Entity/SyncDeleteState.php~ b/Entity/SyncDeleteState.php~ deleted file mode 100644 index 9a83c09..0000000 --- a/Entity/SyncDeleteState.php~ +++ /dev/null @@ -1,110 +0,0 @@ -id; - } - - /** - * @return SyncMapping - */ - public function getMapping() - { - return $this->mapping; - } - - /** - * @param SyncMapping $mapping - * @return SyncDeleteState - */ - public function setMapping($mapping) - { - $this->mapping = $mapping; - return $this; - } - - /** - * @return int - */ - public function getClassId() - { - return $this->classId; - } - - /** - * @param int $classId - * @return SyncDeleteState - */ - public function setClassId($classId) - { - $this->classId = $classId; - return $this; - } - - /** - * @return int - */ - public function getTimestamp() - { - return $this->timestamp; - } - - /** - * @param int $timestamp - * @return SyncDeleteState - */ - public function setTimestamp($timestamp) - { - $this->timestamp = $timestamp; - return $this; - } - -} diff --git a/Entity/SyncFailedItemState.php~ b/Entity/SyncFailedItemState.php~ deleted file mode 100644 index 7088247..0000000 --- a/Entity/SyncFailedItemState.php~ +++ /dev/null @@ -1,191 +0,0 @@ -id; - } - - /** - * Set uuid - * - * @param string $uuid - * - * @return SyncFailedItemState - */ - public function setUuid($uuid) - { - $this->uuid = $uuid; - - return $this; - } - - /** - * Get uuid - * - * @return string - */ - public function getUuid() - { - return $this->uuid; - } - - /** - * Set classId - * - * @param integer $classId - * - * @return SyncFailedItemState - */ - public function setClassId($classId) - { - $this->classId = $classId; - - return $this; - } - - /** - * Get classId - * - * @return integer - */ - public function getClassId() - { - return $this->classId; - } - - /** - * Set timestamp - * - * @param integer $timestamp - * - * @return SyncFailedItemState - */ - public function setTimestamp($timestamp) - { - $this->timestamp = $timestamp; - - return $this; - } - - /** - * Get timestamp - * - * @return integer - */ - public function getTimestamp() - { - return $this->timestamp; - } - - /** - * Set errors - * - * @param string $errors - * - * @return SyncFailedItemState - */ - public function setErrors($errors) - { - $this->errors = $errors; - - return $this; - } - - /** - * Get errors - * - * @return string - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Set mapping - * - * @param \NTI\SyncBundle\Entity\SyncMapping $mapping - * - * @return SyncFailedItemState - */ - public function setMapping(\NTI\SyncBundle\Entity\SyncMapping $mapping = null) - { - $this->mapping = $mapping; - - return $this; - } - - /** - * Get mapping - * - * @return \NTI\SyncBundle\Entity\SyncMapping - */ - public function getMapping() - { - return $this->mapping; - } -} diff --git a/Entity/SyncMapping.php~ b/Entity/SyncMapping.php~ deleted file mode 100644 index 04ac4d2..0000000 --- a/Entity/SyncMapping.php~ +++ /dev/null @@ -1,110 +0,0 @@ -id; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * @return SyncMapping - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * @return string - */ - public function getClass() - { - return $this->class; - } - - /** - * @param string $class - * @return SyncMapping - */ - public function setClass($class) - { - $this->class = $class; - return $this; - } - - /** - * @return string - */ - public function getSyncService() - { - return $this->syncService; - } - - /** - * @param string $syncService - * @return SyncMapping - */ - public function setSyncService($syncService) - { - $this->syncService = $syncService; - return $this; - } - - -} diff --git a/Entity/SyncNewItemState.php~ b/Entity/SyncNewItemState.php~ deleted file mode 100644 index e6e46fb..0000000 --- a/Entity/SyncNewItemState.php~ +++ /dev/null @@ -1,144 +0,0 @@ -id; - } - - /** - * @param int $id - * @return SyncNewItemState - */ - public function setId($id) - { - $this->id = $id; - return $this; - } - - /** - * @return string - */ - public function getUuid() - { - return $this->uuid; - } - - /** - * @param string $uuid - * @return SyncNewItemState - */ - public function setUuid($uuid) - { - $this->uuid = $uuid; - return $this; - } - - /** - * @return SyncMapping - */ - public function getMapping() - { - return $this->mapping; - } - - /** - * @param SyncMapping $mapping - * @return SyncNewItemState - */ - public function setMapping($mapping) - { - $this->mapping = $mapping; - return $this; - } - - /** - * @return int - */ - public function getClassId() - { - return $this->classId; - } - - /** - * @param int $classId - * @return SyncNewItemState - */ - public function setClassId($classId) - { - $this->classId = $classId; - return $this; - } - - /** - * @return int - */ - public function getTimestamp() - { - return $this->timestamp; - } - - /** - * @param int $timestamp - * @return SyncNewItemState - */ - public function setTimestamp($timestamp) - { - $this->timestamp = $timestamp; - return $this; - } - -} diff --git a/Entity/SyncState.php~ b/Entity/SyncState.php~ deleted file mode 100644 index 1e47788..0000000 --- a/Entity/SyncState.php~ +++ /dev/null @@ -1,85 +0,0 @@ -id; - } - - /** - * @return SyncMapping - */ - public function getMapping() - { - return $this->mapping; - } - - /** - * @param SyncMapping $mapping - * @return SyncState - */ - public function setMapping($mapping) - { - $this->mapping = $mapping; - return $this; - } - - /** - * @return int - */ - public function getTimestamp() - { - return $this->timestamp; - } - - /** - * @param int $timestamp - * @return SyncState - */ - public function setTimestamp($timestamp) - { - $this->timestamp = $timestamp; - return $this; - } - -}