<?php

$result = sql_fetch_assoc(
    sql_select_field($config['table_prefix']. "settings", '*', 'name="cbext.clientbase.wazzup"')
);

if (
    isset($result['value']) && !empty($result['value'])
) {
    $settings = \Symfony\Component\Yaml\Yaml::parse($result['value']);

    if (
        isset($settings['table']) && isset($settings['table']['id'])
    ) {
        $phone_field_id = $settings['table']['fields']['phone_field_id']['field_id'];
        run_query("UPDATE `{$config['table_prefix']}fields` SET `name_field` = 'Адресат' WHERE `id` = '$phone_field_id'");
    }
}
