@@ -251,10 +251,9 @@ what actions are allowed on a blog post::
251
251
Using a multiple state marking store
252
252
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253
253
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 ``::
258
257
259
258
// src/Entity/BlogPost.php
260
259
namespace App\Entity;
@@ -270,21 +269,19 @@ type ``json`` ::
270
269
#[ORM\Column]
271
270
private int $id;
272
271
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)]
276
273
private array $currentPlaces;
277
274
278
275
// ...
279
276
}
280
277
281
- .. tip ::
278
+ .. caution ::
282
279
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.
288
285
289
286
Accessing the Workflow in a Class
290
287
---------------------------------
0 commit comments