8000 minor #9781 Mentioned the new Registry::all() method (javiereguiluz) · symfony/symfony-docs@5c4b0b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c4b0b2

Browse files
committed
minor #9781 Mentioned the new Registry::all() method (javiereguiluz)
This PR was merged into the 4.1 branch. Discussion ---------- Mentioned the new Registry::all() method This fixes #9645. Commits ------- b53ef55 Mentioned the new Registry::all() method
2 parents 07c2a0a + b53ef55 commit 5c4b0b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

workflow/usage.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ you can get the workflow by injecting the Workflow registry service::
194194
// pass the workflow name as the second argument
195195
// $workflow = $workflows->get($post, 'blog_publishing');
196196

197+
// you can also get all workflows associated with an object, which is useful
198+
// for example to show the status of all those workflows in a backend
199+
$postWorkflows = $workflows->all($post);
200+
197201
$workflow->can($post, 'publish'); // False
198202
$workflow->can($post, 'to_review'); // True
199203

@@ -213,6 +217,10 @@ you can get the workflow by injecting the Workflow registry service::
213217
The :class:`Symfony\\Component\\Workflow\\Exception\\TransitionException`
214218
class was introduced in Symfony 4.1.
215219

220+
.. versionadded:: 4.1
221+
The :method:`Symfony\\Component\\Workflow\\Registry::all` method was
222+
introduced in Symfony 4.1.
223+
216224
Using Events
217225
------------
218226

0 commit comments

Comments
 (0)
0