File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 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::
858858
859859There is a ``getMetadata() `` method that works with all kinds of metadata::
860860
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') ;
863863
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') ;
866866
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) ;
869869
870870In a :ref: `flash message <flash-messages >` in your controller::
871871
You can’t perform that action at this time.
0 commit comments