Skip to content

Commit 59f65d9

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Added function to get a specific transition
2 parents 03deee8 + c20126a commit 59f65d9

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
@@ -232,6 +232,8 @@ what actions are allowed on a blog post::
232232

233233
// See all the available transitions for the post in the current state
234234
$transitions = $workflow->getEnabledTransitions($post);
235+
// See a specific available transition for the post in the current state
236+
$transition = $workflow->getEnabledTransition($post, 'publish');
235237

236238
Accessing the Workflow in a Class
237239
---------------------------------
@@ -788,6 +790,9 @@ of domain logic in your templates:
788790
``workflow_transitions()``
789791
Returns an array with all the transitions enabled for the given object.
790792

793+
``workflow_transition()``
794+
Returns a specific transition enabled for the given object and transition name.
795+
791796
``workflow_marked_places()``
792797
Returns an array with the place names of the given marking.
793798

@@ -1031,6 +1036,15 @@ In Twig templates, metadata is available via the ``workflow_metadata()`` functio
10311036
{% endfor %}
10321037
</ul>
10331038
</p>
1039+
<p>
1040+
<strong>to_review Priority</strong>
1041+
<ul>
1042+
<li>
1043+
to_review:
1044+
<code>{{ workflow_metadata(blog_post, 'priority', workflow_transition(blog_post, 'to_review')) }}</code>
1045+
</li>
1046+
</ul>
1047+
</p>
10341048

10351049
Learn more
10361050
----------

0 commit comments

Comments
 (0)