@@ -54,12 +54,12 @@ like this:
5454 audit_trail :
5555 enabled : true
5656 marking_store :
57- type : ' multiple_state ' # or 'single_state '
58- arguments :
57+ type : ' method '
58+ property :
5959 - ' currentPlace'
6060 supports :
6161 - App\Entity\BlogPost
62- initial_place : draft
62+ initial_marking : draft
6363 places :
6464 - draft
6565 - reviewed
@@ -90,35 +90,28 @@ like this:
9090 <framework : config >
9191 <framework : workflow name =" blog_publishing" type =" workflow" >
9292 <framework : audit-trail enabled =" true" />
93-
9493 <framework : marking-store type =" single_state" >
9594 <framework : argument >currentPlace</framework : argument >
9695 </framework : marking-store >
97-
9896 <framework : support >App\Entity\BlogPost</framework : support >
99-
97+ < framework : initial-marking >draft</ framework : initial-marking >
10098 <framework : place >draft</framework : place >
10199 <framework : place >reviewed</framework : place >
102100 <framework : place >rejected</framework : place >
103101 <framework : place >published</framework : place >
104-
105102 <framework : transition name =" to_review" >
106103 <framework : from >draft</framework : from >
107104 <framework : to >reviewed</framework : to >
108105 </framework : transition >
109-
110106 <framework : transition name =" publish" >
111107 <framework : from >reviewed</framework : from >
112108 <framework : to >published</framework : to >
113109 </framework : transition >
114-
115110 <framework : transition name =" reject" >
116111 <framework : from >reviewed</framework : from >
117112 <framework : to >rejected</framework : to >
118113 </framework : transition >
119-
120114 </framework : workflow >
121-
122115 </framework : config >
123116 </container >
124117
@@ -134,10 +127,11 @@ like this:
134127 'enabled' => true
135128 ],
136129 'marking_store' => [
137- 'type' => 'multiple_state', // or 'single_state '
138- 'arguments ' => ['currentPlace']
130+ 'type' => 'method '
131+ 'property ' => ['currentPlace']
139132 ],
140133 'supports' => ['App\Entity\BlogPost'],
134+ 'initial_marking' => 'draft',
141135 'places' => [
142136 'draft',
143137 'reviewed',
@@ -177,18 +171,6 @@ As configured, the following property is used by the marking store::
177171 public $content;
178172 }
179173
180- .. note ::
181-
182- The marking store type could be "multiple_state" or "single_state". A single
183- state marking store does not support a model being on multiple places at the
184- same time.
185-
186- .. tip ::
187-
188- The ``type `` (default value ``single_state ``) and ``arguments `` (default
189- value ``marking ``) attributes of the ``marking_store `` option are optional.
190- If omitted, their default values will be used.
191-
192174.. tip ::
193175
194176 Setting the ``audit_trail.enabled `` option to ``true `` makes the application
@@ -200,7 +182,7 @@ what actions are allowed on a blog post::
200182 use App\Entity\BlogPost;
201183 use Symfony\Component\Workflow\Exception\LogicException;
202184
203- $post = BlogPost();
185+ $post = new BlogPost();
204186
205187 $workflow = $this->container->get('workflow.blog_publishing');
206188 $workflow->can($post, 'publish'); // False
@@ -630,8 +612,8 @@ requires:
630612 <framework : from >reviewed</framework : from >
631613 <framework : to >published</framework : to >
632614 <framework : metadata >
633- <framework : hour_limit >20</framework : priority >
634- <framework : explanation >You can not publish after 8 PM.</framework : priority >
615+ <framework : hour_limit >20</framework : hour_limit >
616+ <framework : explanation >You can not publish after 8 PM.</framework : explanation >
635617 </framework : metadata >
636618 </framework : transition >
637619 </framework : workflow >
@@ -682,6 +664,7 @@ Then you can access this metadata in your controller as follows::
682664
683665 use App\Entity\BlogPost;
684666 use Symfony\Component\Workflow\Registry;
667+ use App\Entity\BlogPost;
685668
686669 public function myController(Registry $registry, BlogPost $post)
687670 {
0 commit comments