Skip to content

Commit f556637

Browse files
committed
Merge branch '5.1'
* 5.1: [Workflow] pass arguments to getMetadata method
2 parents 4188b0a + e4fd90c commit f556637

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
@@ -957,14 +957,14 @@ Then you can access this metadata in your controller as follows::
957957

958958
There is a ``getMetadata()`` method that works with all kinds of metadata::
959959

960-
// pass no arguments to getMetadata() to get "workflow metadata"
961-
$title = $workflow->getMetadataStore()->getMetadata()['title'];
960+
// get "workflow metadata" passing the metadata key as argument
961+
$title = $workflow->getMetadataStore()->getMetadata('title');
962962

963-
// pass a string (the place name) to getMetadata() to get "place metadata"
964-
$maxNumOfWords = $workflow->getMetadataStore()->getMetadata('draft')['max_num_of_words'];
963+
// get "place metadata" passing the metadata key as the first argument and the place name as the second argument
964+
$maxNumOfWords = $workflow->getMetadataStore()->getMetadata('max_num_of_words', 'draft');
965965

966-
// pass a Transition object to getMetadata() to get "transition metadata"
967-
$priority = $workflow->getMetadataStore()->getMetadata($aTransition)['priority'];
966+
// get "transition metadata" passing the metadata key as the first argument and a Transition object as the second argument
967+
$priority = $workflow->getMetadataStore()->getMetadata('priority', $aTransition);
968968

969969
In a :ref:`flash message <flash-messages>` in your controller::
970970

0 commit comments

Comments
 (0)