Skip to content

Commit 85268b4

Browse files
committed
Minor tweaks
1 parent 657b8f7 commit 85268b4

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

workflow.rst

+10-13
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ what actions are allowed on a blog post::
251251
Using 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

289286
Accessing the Workflow in a Class
290287
---------------------------------

0 commit comments

Comments
 (0)