Add method to fetch list of workflows to workflow storage
[MAILPOET-4287]
This commit is contained in:
@@ -36,6 +36,16 @@ class WorkflowStorage {
|
|||||||
return $data ? Workflow::fromArray((array)$data) : null;
|
return $data ? Workflow::fromArray((array)$data) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return Workflow[] */
|
||||||
|
public function getWorkflows(): array {
|
||||||
|
$table = esc_sql($this->table);
|
||||||
|
$query = "SELECT * FROM $table ORDER BY id DESC";
|
||||||
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
|
return array_map(function (array $workflowData) {
|
||||||
|
return Workflow::fromArray($workflowData);
|
||||||
|
}, (array)$data);
|
||||||
|
}
|
||||||
|
|
||||||
/** @return string[] */
|
/** @return string[] */
|
||||||
public function getActiveTriggerKeys(): array {
|
public function getActiveTriggerKeys(): array {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
|
@@ -49,7 +49,7 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: ../../lib/Automation/Engine/Storage/WorkflowRunStorage.php
|
path: ../../lib/Automation/Engine/Storage/WorkflowRunStorage.php
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast string|void to string.$#"
|
message: "#^Cannot cast string|void to string\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
path: ../../lib/Automation/Engine/Storage/WorkflowStorage.php
|
path: ../../lib/Automation/Engine/Storage/WorkflowStorage.php
|
||||||
reportUnmatchedIgnoredErrors: true
|
reportUnmatchedIgnoredErrors: true
|
||||||
|
Reference in New Issue
Block a user