From fb10bdce5aa0d5ebb59b71c0c01abaaa033c3fff Mon Sep 17 00:00:00 2001 From: Richard Henkenjohann Date: Wed, 31 Jul 2024 22:10:48 +0200 Subject: [PATCH 1/2] Update workflow.rst --- workflow.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflow.rst b/workflow.rst index f3f04b3feea..3e1ccc16f60 100644 --- a/workflow.rst +++ b/workflow.rst @@ -283,6 +283,12 @@ if you are using Doctrine, the matching column definition should use the type `` this Doctrine type will store its value only as a string, resulting in the loss of the object's current place. +.. tip:: + + On a database level, you can check the current place as follows: + ``[WHERE] JSON_CONTAINS_PATH(item.currentPlaces, 'one', '$.draft')`` + (where `draft` is the place to be checked) + Accessing the Workflow in a Class --------------------------------- From e8952bbb9bce093b6c57fd5fd031f7c4dfd8368f Mon Sep 17 00:00:00 2001 From: Richard Henkenjohann Date: Wed, 31 Jul 2024 22:46:24 +0200 Subject: [PATCH 2/2] Update workflow.rst --- workflow.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow.rst b/workflow.rst index 3e1ccc16f60..6722a9851f3 100644 --- a/workflow.rst +++ b/workflow.rst @@ -285,8 +285,11 @@ if you are using Doctrine, the matching column definition should use the type `` .. tip:: - On a database level, you can check the current place as follows: - ``[WHERE] JSON_CONTAINS_PATH(item.currentPlaces, 'one', '$.draft')`` + On a database level, querying or filtering for multiple state marking stores + requires special handling. When using Doctrine with MySQL, you can install + `scienta/doctrine-json-functions` and enable the `JSON_CONTAINS_PATH` doctrine + function. Then you can filter for a current place as follows: + ``$qb->andWhere("JSON_CONTAINS_PATH(item.currentPlaces, 'one', '$.draft') <> 0")`` (where `draft` is the place to be checked) Accessing the Workflow in a Class