Skip to content

hotfix: missing the call to InstanceOfSupportStrategy #9233

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 2 commits into from
Feb 9, 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
5 changes: 3 additions & 2 deletions components/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ A registry will also help you to decide if a workflow supports the object you
are trying to use it with::

use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\WorkflowInterface\InstanceOfSupportStrategy;
use Acme\Entity\BlogPost;
use Acme\Entity\Newsletter;

$blogWorkflow = ...
$newsletterWorkflow = ...

$registry = new Registry();
$registry->addWorkflow($blogWorkflow, BlogPost::class);
$registry->addWorkflow($newsletterWorkflow, Newsletter::class);
$registry->addWorkflow($blogWorkflow, new InstanceOfSupportStrategy(BlogPost::class));
$registry->addWorkflow($newsletterWorkflow, new InstanceOfSupportStrategy(Newsletter::class));

.. versionadded:: 4.1
The ``addWorkflow()`` method was introduced in Symfony 4.1. In previous
Expand Down