【问题标题】:Keep field Position on PodioAppField::update在 Podio App Field::update 上保持字段位置
【发布时间】:2017-11-01 12:00:45
【问题描述】:

我正在关注文档 https://developers.podio.com/doc/applications 和 SDK 中的给定模型。

我正在向现有应用引用添加一个新应用,如下所示:

$attributes = array( 
        "referenced_apps" => array(ref_app_id1 , ref_app_id2)                        
    );

PodioAppField::update( 123 ,  'field_id' ,array (
                                                "settings" => $attributes
                                           ));

我现在的问题是,该字段以前位于位置 2,而我在位置 1 上有一个计算字段。 更新应用后位置发生了变化。

是否可以将字段保持在其原始位置而不将前面的字段添加到更新中? - 还是我必须重复前面的计算等?

TIA

【问题讨论】:

    标签: php podio


    【解决方案1】:

    是的,除了设置之外,您还可以使用属性 delta 保持当前位置。最好的方法是

    $existing_field_config = PodioAppField::get( $app_id, $field_id )->config;
    

    然后将新属性添加到现有的config变量中,使其他字段配置保持不变。

    $existing_field_config['settings']['referenced_apps'] = array(ref_app_id1 , ref_app_id2);
    PodioAppField::update( 123 ,  'field_id' ,array (
                                                "settings" => $existing_field_config
                                           ));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多