Fixing generation of SetPrimaryFieldsChanged

This commit is contained in:
Pavel Shevaev 2023-08-01 12:08:18 +03:00
parent 7d7afbb2da
commit 2dee7aa756
1 changed files with 3 additions and 14 deletions

View File

@ -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);
}