Make workflow run logs immutable

[MAILPOET-4463]
This commit is contained in:
John Oleksowicz
2022-09-12 12:33:03 -05:00
committed by Jan Jakeš
parent cdeea173b9
commit 6f8edfaec4
5 changed files with 2 additions and 57 deletions

View File

@ -28,21 +28,6 @@ class WorkflowRunLogStorage {
return $this->wpdb->insert_id;
}
public function updateWorkflowRunLog(WorkflowRunLog $workflowRunLog): int {
$data = $workflowRunLog->toArray();
unset($data['id']);
$data['updated_at'] = (new \DateTimeImmutable())->format(\DateTimeImmutable::W3C);
$where = ['id' => $workflowRunLog->getId()];
$result = $this->wpdb->update($this->table, $data, $where);
if ($result === false) {
throw Exceptions::databaseError($this->wpdb->last_error);
}
return $result;
}
public function getWorkflowRunLog(int $id): ?WorkflowRunLog {
$table = esc_sql($this->table);
$query = $this->wpdb->prepare("SELECT * FROM $table WHERE id = %d", $id);