Make workflow run logs immutable
[MAILPOET-4463]
This commit is contained in:
committed by
Jan Jakeš
parent
cdeea173b9
commit
6f8edfaec4
@ -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);
|
||||
|
Reference in New Issue
Block a user