Skip to content

Commit

Permalink
backing up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Enercido Alcantara committed Jan 18, 2018
1 parent 6e378c6 commit db01aa9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Controller/SyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion Entity/SyncDeleteState.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,3 @@ public function setTimestamp($timestamp)
}

}

1 change: 0 additions & 1 deletion Entity/SyncMapping.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,3 @@ public function setSyncService($syncService)


}

2 changes: 1 addition & 1 deletion Entity/SyncNewItemState.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public function setTimestamp($timestamp)
return $this;
}

}
}
1 change: 0 additions & 1 deletion Entity/SyncState.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ public function setTimestamp($timestamp)
}

}

7 changes: 6 additions & 1 deletion Service/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class SyncService {
*/
public function __construct(ContainerInterface $container) {
$this->container = $container;

}

/**
Expand Down Expand Up @@ -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)) {
Expand All @@ -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],
);
}
Expand Down

0 comments on commit db01aa9

Please sign in to comment.