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

Skip to content

Mentioned the new Registry::all() method #9781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions workflow/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ you can get the workflow by injecting the Workflow registry service::
// pass the workflow name as the second argument
// $workflow = $workflows->get($post, 'blog_publishing');

// you can also get all workflows associated with an object, which is useful
// for example to show the status of all those workflows in a backend
$postWorkflows = $workflows->all($post);

$workflow->can($post, 'publish'); // False
$workflow->can($post, 'to_review'); // True

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

.. versionadded:: 4.1
The :method:`Symfony\\Component\\Workflow\\Registry::all` method was
introduced in Symfony 4.1.

Using Events
------------

Expand Down
0