diff --git a/workflow/usage.rst b/workflow/usage.rst index 9396e3b95d1..bf35abbbfad 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,24 +138,33 @@ like this: class BlogPost { - // This property is used by the marking store public $currentPlace; public $title; public $content; } +.. tip:: + + The ``type`` (default value ``single_state``) and ``arguments`` (default value ``marking``) + attributes of the ``marking_store`` option are optional. If omitted, their default values + will be used. + .. note:: The marking store type could be "multiple_state" or "single_state". A single state marking store does not support a model being on multiple places at the same time. + + If a ``multiple_state`` is used, the attribute should be an ``array``, + using Doctrine, you can use ``json``. -.. tip:: - - The ``type`` (default value ``single_state``) and ``arguments`` (default value ``marking``) - attributes of the ``marking_store`` option are optional. If omitted, their default values - will be used. + If a ``single_state`` is used, the persisted state type should be a string, + if you need to store an int (due to DB limitations and/or project constraints), + be aware that you need to implement :class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface` + in order to transform the int back to something understandable by Workflow. + If something else is used, you're in charge of choosing the best storage format. + With this workflow named ``blog_publishing``, you can get help to decide what actions are allowed on a blog post::