Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
24 changes: 1 addition & 23 deletions workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,28 +275,6 @@ machine type, use ``camelCased workflow name + StateMachine``::
}
}

Alternatively, use the registry::

use App\Entity\BlogPost;
use Symfony\Component\Workflow\Registry;

class MyClass
{
private $workflowRegistry;

public function __construct(Registry $workflowRegistry)
{
$this->workflowRegistry = $workflowRegistry;
}

public function toReview(BlogPost $post)
{
$blogPublishingWorkflow = $this->workflowRegistry->get($post);

// ...
}
}

.. tip::

You can find the list of available workflow services with the
Expand Down Expand Up @@ -1051,7 +1029,7 @@ In a :ref:`flash message <flash-messages>` in your controller::

// $transition = ...; (an instance of Transition)

// $workflow is a Workflow instance retrieved from the Registry or injected directly (see above)
// $workflow is an injected Workflow instance
$title = $workflow->getMetadataStore()->getMetadata('title', $transition);
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");

Expand Down