Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Vison committed Jan 5, 2018
1 parent 6270cee commit 1446225
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions Controller/SyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,6 @@ public function pushAction(Request $request) {

if(!$mapping) { continue; }

// Create all the SyncNewItemState
// Not sure if actually needed
// foreach($entry["data"] as $data) {
// if(!isset($data["serverId"]) || $data["serverId"] != 0 || !isset($data["id"])) {
// continue;
// }
//
// // Look for a SyncNewItemState
// $syncNewItemState = $em->getRepository('NTISyncBundle:SyncNewItemState')->findOneBy(array(
// "uuid" => $data["id"],
// "mapping" => $mapping
// ));
//
// if(!$syncNewItemState) {
// $syncNewItemState = new SyncNewItemState();
// $syncNewItemState->setUuid($data["id"]);
// $syncNewItemState->setTimestamp(time());
// $syncNewItemState->setMapping($mapping);
// $em->persist($syncNewItemState);
// $em->flush();
// }
// }

$syncClass = $mapping->getSyncService();

if(!class_exists($syncClass)) { continue; }
Expand All @@ -131,18 +108,23 @@ public function pushAction(Request $request) {
try {
$result = $service->sync($entry["data"], $em, $mapping);
} catch (\Exception $ex) {

$additionalErrors = array();

try {
$additionalErrors = $service->onSyncException($ex, $this->container);
$additionalErrors = (is_array($additionalErrors)) ? $additionalErrors : array();
} catch (\Exception $ex) {
// TBD
}

$result = array(
"error" => "An unknown error occurred while processing the synchronization for this mapping",
"additional_errors" => $additionalErrors,
);

$results[$mappingName] = $result;

$em->clear();
continue;
}
Expand Down

0 comments on commit 1446225

Please sign in to comment.