From dcf2e72d7160d87e9cc190d75947153501831d7e Mon Sep 17 00:00:00 2001 From: Orlyapps Date: Thu, 16 Sep 2021 10:01:34 +0200 Subject: [PATCH] feat: get transition array from workflow --- src/Models/WorkflowDefinition.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Models/WorkflowDefinition.php b/src/Models/WorkflowDefinition.php index c4075b1..e2fd1a2 100644 --- a/src/Models/WorkflowDefinition.php +++ b/src/Models/WorkflowDefinition.php @@ -67,6 +67,15 @@ function ($place) { } ); } + + public function transistionsOptionArray() + { + return $this->toArray()['transitions']->mapWithKeys( + function ($place) { + return [array_key_first($place) => head($place)['metadata']['title']]; + } + ); + } public function place($placeName)