From 8d326cbab5e6eaeacdc41c3285be22b2285cfe13 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 1 Sep 2023 16:09:39 +0200 Subject: [PATCH] [Workflow] Mention that the initial marking is configured, not set in code --- workflow.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workflow.rst b/workflow.rst index 02abd4da037..c057affbf87 100644 --- a/workflow.rst +++ b/workflow.rst @@ -189,6 +189,9 @@ The configured property will be used via its implemented getter/setter methods b { $this->currentPlace = $currentPlace; } + + // you don't need to set the initial marking in the constructor or any other method; + // this is configured in the workflow with the 'initial_marking' option } .. note:: @@ -225,6 +228,8 @@ what actions are allowed on a blog post:: use Symfony\Component\Workflow\Exception\LogicException; $post = new BlogPost(); + // you don't need to set the initial marking with code; this is configured + // in the workflow with the 'initial_marking' option $workflow = $this->container->get('workflow.blog_publishing'); $workflow->can($post, 'publish'); // False