@@ -665,7 +665,7 @@ of domain logic in your templates:
665
665
666
666
``workflow_has_marked_place() ``
667
667
Returns ``true `` if the marking of the given object has the given state.
668
-
668
+
669
669
``workflow_transition_blockers() ``
670
670
Returns :class: `Symfony\\ Component\\ Workflow\\ TransitionBlockerList ` for the given transition.
671
671
@@ -700,7 +700,7 @@ The following example shows these functions in action:
700
700
{% if 'reviewed' in workflow_marked_places(post) %}
701
701
<span class="label">Reviewed</span>
702
702
{% endif %}
703
-
703
+
704
704
{# Loop through the transition blockers #}
705
705
{% for blocker in workflow_transition_blockers(post, 'publish') %}
706
706
<span class="error">{{ blocker.message }}</span>
@@ -856,14 +856,14 @@ Then you can access this metadata in your controller as follows::
856
856
857
857
There is a ``getMetadata() `` method that works with all kinds of metadata::
858
858
859
- // pass no arguments to getMetadata() to get "workflow metadata"
860
- $title = $workflow->getMetadataStore()->getMetadata()[ 'title'] ;
859
+ // get "workflow metadata" passing the metadata key as argument
860
+ $title = $workflow->getMetadataStore()->getMetadata('title') ;
861
861
862
- // pass a string ( the place name) to getMetadata() to get " place metadata"
863
- $maxNumOfWords = $workflow->getMetadataStore()->getMetadata('draft')['max_num_of_words'] ;
862
+ // get "place metadata" passing the metadata key as the first argument and the place name as the second argument
863
+ $maxNumOfWords = $workflow->getMetadataStore()->getMetadata('max_num_of_words', 'draft') ;
864
864
865
- // pass a Transition object to getMetadata() to get "transition metadata"
866
- $priority = $workflow->getMetadataStore()->getMetadata($aTransition)[ 'priority'] ;
865
+ // get "transition metadata" passing the metadata key as the first argument and a Transition object as the second argument
866
+ $priority = $workflow->getMetadataStore()->getMetadata('priority', $aTransition) ;
867
867
868
868
In a :ref: `flash message <flash-messages >` in your controller::
869
869
0 commit comments