Skip to content

Commit 9b704d5

Browse files
committed
Added function to get a specific transition
1 parent 57e3020 commit 9b704d5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

workflow.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ what actions are allowed on a blog post::
229229

230230
// See all the available transitions for the post in the current state
231231
$transitions = $workflow->getEnabledTransitions($post);
232+
// See a specific available transition for the post in the current state
233+
$transition = $workflow->getEnabledTransition($post, 'publish');
232234

233235
Accessing the Workflow in a Class
234236
---------------------------------
@@ -649,6 +651,9 @@ of domain logic in your templates:
649651
``workflow_transitions()``
650652
Returns an array with all the transitions enabled for the given object.
651653

654+
``workflow_transition()``
655+
Returns a specific transitions enabled for the given object and transition name.
656+
652657
``workflow_marked_places()``
653658
Returns an array with the place names of the given marking.
654659

@@ -883,6 +888,15 @@ In Twig templates, metadata is available via the ``workflow_metadata()`` functio
883888
{% endfor %}
884889
</ul>
885890
</p>
891+
<p>
892+
<strong>to_review Priority</strong>
893+
<ul>
894+
<li>
895+
to_review:
896+
<code>{{ workflow_metadata(blog_post, 'priority', workflow_transition(blog_post, 'to_review')) }}</code>
897+
</li>
898+
</ul>
899+
</p>
886900

887901
Learn more
888902
----------

0 commit comments

Comments
 (0)