Skip to content

Commit

Permalink
Merge pull request ntidev#5 from ealcantara22/fail-items-inclution
Browse files Browse the repository at this point in the history
Fail items inclution
  • Loading branch information
ntidev authored Mar 13, 2018
2 parents f19cba1 + 659e34e commit 46d2b63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Service/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public function getFromMappings($mappings) {

$deletes = $this->em->getRepository(SyncDeleteState::class)->findFromTimestamp($mappingName, $timestamp);
$newItems = $this->em->getRepository(SyncNewItemState::class)->findFromTimestampAndMapping($mappingName, $timestamp);
/**
* Failed Items Synchronization
*/
$failedItems = $this->em->getRepository('NTISyncBundle:SyncFailedItemState')->findFromTimestampAndMapping($mappingName, $timestamp);

/** @var SyncRepositoryInterface $repository */
$repository = $this->em->getRepository($syncMapping->getClass());
Expand All @@ -76,6 +80,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],
);
}
Expand Down Expand Up @@ -136,4 +141,4 @@ public function addToDeleteSyncState($class, $id) {
error_log($ex->getMessage());
}
}
}
}

0 comments on commit 46d2b63

Please sign in to comment.