Verified Commit 534a9031 authored by Cyril Vazquez's avatar Cyril Vazquez Committed by Arnaud Pauget
Browse files

Use medona/abstractMessage::update() instead of sdoFactory

parent cfd74bd5
......@@ -284,7 +284,7 @@ class ArchiveDeliveryRequest extends abstractMessage
$message = $this->sdoFactory->read('medona/message', array('messageId' => $messageId));
$message->derogation = "true";
$this->sdoFactory->update($message);
$this->update($message);
$event = $this->lifeCycleJournalController->logEvent(
'medona/authorization',
......@@ -407,7 +407,7 @@ class ArchiveDeliveryRequest extends abstractMessage
} catch (\Exception $e) {
$message->status = "error";
$operationResult = false;
$this->sdoFactory->update($message);
$this->update($message);
throw $e;
}
......@@ -421,7 +421,7 @@ class ArchiveDeliveryRequest extends abstractMessage
$message->status = "processed";
return $this->sdoFactory->update($message);
return $this->update($message);
}
/**
......
......@@ -216,7 +216,7 @@ class ArchiveDestructionRequest extends abstractMessage
$this->archiveController->eliminate((string) $unitIdentifier->objectId);
}
$this->sdoFactory->update($message);
$this->update($message);
}
/**
......@@ -239,7 +239,7 @@ class ArchiveDestructionRequest extends abstractMessage
true
);
$this->sdoFactory->update($message);
$this->update($message);
}
/**
......
......@@ -404,9 +404,8 @@ class ArchiveRestitution extends abstractMessage
$message = $this->sdoFactory->read('medona/message', array("messageId" => $messageId));
$message->active = false;
$this->sdoFactory->update($message, "medona/message");
$this->update($message);
$this->changeStatus($messageId, "validated");
$uri = $this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId;
......
......@@ -381,7 +381,7 @@ class ArchiveRestitutionRequest extends abstractMessage
} catch (\Exception $e) {
$message->status = "error";
$operationResult = false;
$this->sdoFactory->update($message);
$this->update($message);
throw $e;
}
......@@ -394,7 +394,7 @@ class ArchiveRestitutionRequest extends abstractMessage
);
$message->status = "processed";
$this->sdoFactory->update($message);
$this->update($message);
return true;
}
......
......@@ -61,7 +61,7 @@ class ArchiveRestitutionRequestReply extends abstractMessage
$requestMessage->replyReference = $message->reference;
$this->sdoFactory->update($requestMessage, "medona/message");
$this->update($requestMessage);
$message->senderOrgRegNumber = $requestMessage->recipientOrgRegNumber;
$message->recipientOrgRegNumber = $requestMessage->senderOrgRegNumber;
......
......@@ -464,7 +464,7 @@ class ArchiveTransfer extends abstractMessage
);
}
$this->sdoFactory->update($message);
$this->update($message);
}
if ($this->currentArchivalAgreement && $this->currentArchivalAgreement->autoTransferAcceptance) {
......@@ -563,7 +563,7 @@ class ArchiveTransfer extends abstractMessage
$message->comment = json_encode($message->comment);
}
$this->sdoFactory->update($message);
$this->update($message);
if ($sendReply) {
$archiveTransferReplyController = \laabs::newController('medona/ArchiveTransferReply');
......@@ -777,7 +777,7 @@ class ArchiveTransfer extends abstractMessage
$operationResult = true;
} catch (\Exception $e) {
$message->status = "error";
$this->sdoFactory->update($message);
$this->update($message);
$this->lifeCycleJournalController->logEvent(
'medona/processing',
......@@ -850,7 +850,7 @@ class ArchiveTransfer extends abstractMessage
}
$message->status = "processed";
$this->sdoFactory->update($message);
$this->update($message);
} catch (\Exception $e) {
if ($transactionControl) {
$this->sdoFactory->rollback();
......@@ -858,7 +858,7 @@ class ArchiveTransfer extends abstractMessage
$message->status = "error";
$operationResult = false;
$this->sdoFactory->update($message);
$this->update($message);
$this->lifeCycleJournalController->logEvent(
'medona/processing',
......
......@@ -324,7 +324,7 @@ class ArchiveTransferSending extends abstractMessage
$messageObject = json_decode($message->data);
$messageObject->comment[] = $comment;
$message->data = json_encode($messageObject);
$this->sdoFactory->update($message, "medona/message");
$this->update($message, "medona/message");
$message->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $message);
......@@ -357,7 +357,7 @@ class ArchiveTransferSending extends abstractMessage
$message = $this->sdoFactory->read('medona/message', array("messageId" => $messageId));
$message->active = false;
$this->sdoFactory->update($message, "medona/message");
$this->update($message, "medona/message");
$message->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $message);
......
......@@ -94,7 +94,7 @@ class AuthorizationOriginatingAgencyRequestReply extends abstractMessage
$this->save($message);
}
$this->sdoFactory->update($requestMessage, "medona/message");
$this->update($requestMessage);
} catch (\Exception $e) {
$message->status = "invalid";
}
......
......@@ -623,10 +623,10 @@ class message
$parentMessage = $this->sdoFactory->read('medona/message', $parentKey);
$parentMessage->active = false;
$this->sdoFactory->update($parentMessage);
$this->update($parentMessage);
}
$this->sdoFactory->update($message);
$this->update($message);
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment