Fetch workflow, workflow run, and step in workflow step runner

[MAILPOET-4136]
This commit is contained in:
Jan Jakes
2022-03-07 12:18:47 +01:00
committed by Veljko V
parent 66eaf555b5
commit a7cd2b74b4
4 changed files with 66 additions and 2 deletions

View File

@@ -26,4 +26,10 @@ class WorkflowRunStorage {
}
return $this->wpdb->insert_id;
}
public function getWorkflowRun(int $id): ?WorkflowRun {
$query = strval($this->wpdb->prepare("SELECT * FROM $this->table WHERE id = %d", $id));
$data = $this->wpdb->get_row($query, ARRAY_A);
return $data ? WorkflowRun::fromArray((array)$data) : null;
}
}