Skip to content

Commit 8b36b82

Browse files
lubo13javiereguiluz
authored andcommitted
[Workflow] pass arguments to getMetadata method
1 parent 0beb1b0 commit 8b36b82

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

workflow.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -858,14 +858,14 @@ Then you can access this metadata in your controller as follows::
858858

859859
There 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

870870
In a :ref:`flash message <flash-messages>` in your controller::
871871

0 commit comments

Comments
 (0)