File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -858,14 +858,14 @@ Then you can access this metadata in your controller as follows::
858
858
859
859
There is a ``getMetadata() `` method that works with all kinds of metadata::
860
860
861
- // pass no arguments to getMetadata() to get "workflow metadata"
862
- $title = $workflow->getMetadataStore()->getMetadata()[ 'title'] ;
861
+ // pass a string (the key of workflow metadata) to getMetadata() to get "workflow metadata" by key
862
+ $title = $workflow->getMetadataStore()->getMetadata('title') ;
863
863
864
- // pass a string (the place name) to getMetadata() to get "place metadata"
865
- $maxNumOfWords = $workflow->getMetadataStore()->getMetadata('draft')['max_num_of_words'] ;
864
+ // pass two arguments: a string (the key of place metadata) and a string (the place name) to getMetadata() to get "place metadata" by key
865
+ $maxNumOfWords = $workflow->getMetadataStore()->getMetadata('max_num_of_words', 'draft') ;
866
866
867
- // pass a Transition object to getMetadata() to get "transition metadata"
868
- $priority = $workflow->getMetadataStore()->getMetadata($aTransition)[ 'priority'] ;
867
+ // pass two arguments: a string (the key of transition metadata) and a Transition object to getMetadata() to get "transition metadata" by key
868
+ $priority = $workflow->getMetadataStore()->getMetadata('priority', $aTransition) ;
869
869
870
870
In a :ref: `flash message <flash-messages >` in your controller::
871
871
You can’t perform that action at this time.
0 commit comments