File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -673,18 +673,28 @@ Then you can access this metadata in your controller as follows::
673
673
->getWorkflowMetadata()['title'] ?? 'Default title'
674
674
;
675
675
676
- // or
676
+ $maxNumOfWords = $workflow
677
+ ->getMetadataStore()
678
+ ->getPlaceMetadata('draft')['max_num_of_words'] ?? 500
679
+ ;
680
+
677
681
$aTransition = $workflow->getDefinition()->getTransitions()[0];
678
- $transitionTitle = $workflow
682
+ $priority = $workflow
679
683
->getMetadataStore()
680
684
->getTransitionMetadata($aTransition)['priority'] ?? 0
681
685
;
682
686
}
683
687
684
- There is a shortcut that works with every metadata level::
688
+ There is a ``getMetadata() `` method that works with all kinds of metadata::
689
+
690
+ // pass no arguments to getMetadata() to get "workflow metadata"
691
+ $title = $workflow->getMetadataStore()->getMetadata()['title'];
692
+
693
+ // pass a string (the place name) to getMetadata() to get "place metadata"
694
+ $maxNumOfWords = $workflow->getMetadataStore()->getMetadata('draft')['max_num_of_words'];
685
695
686
- $title = $workflow->getMetadataStore()-> getMetadata('title');
687
- $priority = $workflow->getMetadataStore()->getMetadata('priority') ;
696
+ // pass a Transition object to getMetadata() to get "transition metadata"
697
+ $priority = $workflow->getMetadataStore()->getMetadata($aTransition)[ 'priority'] ;
688
698
689
699
In a :ref: `flash message <flash-messages >` in your controller::
690
700
You can’t perform that action at this time.
0 commit comments