From 3a8913471123126c62fc1dd3dbc2ec5e653c0a14 Mon Sep 17 00:00:00 2001 From: Daniel Kirkland Date: Fri, 16 Oct 2026 11:18:59 +0200 Subject: [PATCH 1/2] docs: fix what merge() does in the entity versioning guide Co-Authored-By: Claude Sonnet 5.5 --- .../plugins/framework/data-handling/versioning-entities.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/plugins/plugins/framework/data-handling/versioning-entities.md b/guides/plugins/plugins/framework/data-handling/versioning-entities.md index b4fd04e7ea..4135d54287 100644 --- a/guides/plugins/plugins/framework/data-handling/versioning-entities.md +++ b/guides/plugins/plugins/framework/data-handling/versioning-entities.md @@ -52,7 +52,7 @@ protected function defineFields(): FieldCollection ## Create and merge version In this section we will create a new version of our entity which will create a new entry in the database with our updated values. -When we merge a particular version, all versions before the merged version are deleted. +When we merge a particular version, its changes are written into the version of the context we pass in, and the records of the merged version are deleted. In the example below, we are using a service where we injected a `swag_example.repository`. ```php @@ -109,8 +109,8 @@ Subsequently, we searched the repository with the original context and our new v In the first search result, using the original context, we get the first version of our entity, which we created at the beginning. With the second search result we get the updated entity, using our new versioned context. -Lastly, we used the repository method `merge` with our versionId, which deletes all versions before this one. -The merged version is now our new live version. From now on we can find it without using a versioned context. +Lastly, we used the repository method `merge` with our versionId, which writes the changes of this version into the version of the context we pass in, here the live version, and then deletes the records of the merged version. +From now on we can find the updated data without using a versioned context. ## Versioning with foreign keys From 0c445dbb8cbafedc2b1432d0c8dd04a753d7f623 Mon Sep 17 00:00:00 2001 From: Daniel Kirkland Date: Fri, 16 Oct 2026 11:44:48 +0200 Subject: [PATCH 2/2] docs: say that merge() also deletes the merged version itself Co-Authored-By: Claude Sonnet 5.5 --- .../plugins/framework/data-handling/versioning-entities.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/plugins/plugins/framework/data-handling/versioning-entities.md b/guides/plugins/plugins/framework/data-handling/versioning-entities.md index 4135d54287..57b5f505c8 100644 --- a/guides/plugins/plugins/framework/data-handling/versioning-entities.md +++ b/guides/plugins/plugins/framework/data-handling/versioning-entities.md @@ -52,7 +52,7 @@ protected function defineFields(): FieldCollection ## Create and merge version In this section we will create a new version of our entity which will create a new entry in the database with our updated values. -When we merge a particular version, its changes are written into the version of the context we pass in, and the records of the merged version are deleted. +When we merge a particular version, its changes are written into the version of the context we pass in, and the merged version is deleted together with its records. In the example below, we are using a service where we injected a `swag_example.repository`. ```php @@ -109,7 +109,7 @@ Subsequently, we searched the repository with the original context and our new v In the first search result, using the original context, we get the first version of our entity, which we created at the beginning. With the second search result we get the updated entity, using our new versioned context. -Lastly, we used the repository method `merge` with our versionId, which writes the changes of this version into the version of the context we pass in, here the live version, and then deletes the records of the merged version. +Lastly, we used the repository method `merge` with our versionId, which writes the changes of this version into the version of the context we pass in (here the original context, whose version is the live one), and then deletes the merged version together with its records. From now on we can find the updated data without using a versioned context. ## Versioning with foreign keys