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::
673673 ->getWorkflowMetadata()['title'] ?? 'Default title'
674674 ;
675675
676- // or
676+ $maxNumOfWords = $workflow
677+ ->getMetadataStore()
678+ ->getPlaceMetadata('draft')['max_num_of_words'] ?? 500
679+ ;
680+
677681 $aTransition = $workflow->getDefinition()->getTransitions()[0];
678- $transitionTitle = $workflow
682+ $priority = $workflow
679683 ->getMetadataStore()
680684 ->getTransitionMetadata($aTransition)['priority'] ?? 0
681685 ;
682686 }
683687
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'];
685695
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'] ;
688698
689699In a :ref: `flash message <flash-messages >` in your controller::
690700
You can’t perform that action at this time.
0 commit comments