@@ -251,10 +251,9 @@ what actions are allowed on a blog post::
251251Using a multiple state marking store
252252~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253253
254- If you are creating a :doc: `workflow </workflow/workflow-and-state-machine >`
255- , your marking store may need to contain multiple places at the same time.
256- If you are using Doctrine, the matching column definition should use the
257- type ``json `` ::
254+ If you are creating a :doc: `workflow </workflow/workflow-and-state-machine >`,
255+ your marking store may need to contain multiple places at the same time. That's why,
256+ if you are using Doctrine, the matching column definition should use the type ``json ``::
258257
259258 // src/Entity/BlogPost.php
260259 namespace App\Entity;
@@ -270,21 +269,19 @@ type ``json`` ::
270269 #[ORM\Column]
271270 private int $id;
272271
273- // Type declaration is not mandatory and
274- // matches the guessed value from Doctrine
275- #[ORM\Column(type: Types::JSON)] // or #[ORM\Column(type: 'json')]
272+ #[ORM\Column(type: Types::JSON)]
276273 private array $currentPlaces;
277274
278275 // ...
279276 }
280277
281- .. tip ::
278+ .. caution ::
282279
283- You should not use the type ``simple_array `` for your marking store.
284- Inside a multiple state marking store, places are store as keys with
285- a value of one, such as ``['draft' => 1] ``. If the marking store contains
286- only one place, this Doctrine type will store its value only as a string,
287- resulting in the loss of the object's current place.
280+ You should not use the type ``simple_array `` for your marking store. Inside
281+ a multiple state marking store, places are stored as keys with a value of one,
282+ such as ``['draft' => 1] ``. If the marking store contains only one place,
283+ this Doctrine type will store its value only as a string, resulting in the
284+ loss of the object's current place.
288285
289286Accessing the Workflow in a Class
290287---------------------------------
0 commit comments