diff --git a/workflow.rst b/workflow.rst index 64035c1bd86..ff5b6c4dc5b 100644 --- a/workflow.rst +++ b/workflow.rst @@ -265,27 +265,19 @@ machine type, use ``camelCased workflow name + StateMachine``:: } } -Alternatively, use the registry:: +.. versionadded:: 6.2 - use App\Entity\BlogPost; - use Symfony\Component\Workflow\Registry; - - class MyClass - { - private $workflowRegistry; + All workflows and state machines services are tagged since in Symfony 6.2. - public function __construct(Registry $workflowRegistry) - { - $this->workflowRegistry = $workflowRegistry; - } +.. tip:: - public function toReview(BlogPost $post) - { - $blogPublishingWorkflow = $this->workflowRegistry->get($post); + If you want to retrieve all workflows, for documentation purposes for example, + you can :doc:`inject all services ` + with the following tag: - // ... - } - } + * ``workflow``: all workflows and all state machine; + * ``workflow.workflow``: all workflows; + * ``workflow.state_machine``: all state machines. .. tip::