From 2dee7aa756d3ed7725d02e0a0990df91dfe0557b Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 1 Aug 2023 12:08:18 +0300 Subject: [PATCH] Fixing generation of SetPrimaryFieldsChanged --- src/codegen.inc.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 1ad679c..d650b49 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -27,11 +27,9 @@ function supported_tokens() 'bitfields', 'cloneable', 'virtual', - 'id', - 'owner', - 'pkey', 'obscured', 'diffable', + 'table_pkey', 'bhl_bind', 'cs_attributes', 'cs_accessor_interface', @@ -472,17 +470,8 @@ function fields_count_self(\mtgMetaStruct $struct) function is_primary_field(\mtgMetaStruct $struct, $fld) { $primary_fields = array(); - if($struct->hasToken("id")) - $primary_fields[] = $struct->getToken("id"); - - if($struct->hasToken("owner")) - $primary_fields[] = $struct->getToken("owner"); - - if($struct->hasToken("pkey")) - { - foreach(explode(",", $struct->getToken("pkey")) as $name) - $primary_fields[] = $name; - } + if($struct->hasToken("table_pkey")) + $primary_fields = explode(",", $struct->getToken("table_pkey")); return in_array($fld->getName(), $primary_fields); }