波迪奥:麻烦的关系应用领域的分配基准 [英] Podio : Troubles assigning reference for a Relationship app field
问题描述
我编程方式创建一个应用程序有关系的应用领域
I programmatically created an app with a relationship app field
$app = new PodioApp($attributes);
它已成功创建后,我想创建一个应用程序的关系领域
After it had been successfully created, I wanted to create a relationship app field
$field_id = PodioAppField::create( array (
"type => "app",
"external_id" => "test",
"config" => array (
"label" => "Test field",
"settings" => array()
)
));
实际上,该字段在波迪奥创建。现在,我想分配为关联字段参考应用和我的code是如下:
Indeed, the field is created in podio. Now, I want to assign the reference app for that relationship field and my code is as follow:
$settings = array(
"apps" => array (
array("app_id" => 10036463)
)
);
PodioAppField::update($app->app_id, $field_id, array (
"label" => "Updated_test_field",
"settings" => $settings
));
有要么是在屏幕上或在日志文件中显示没有错误。然而,当我检查我的工作空间我的应用程序模板,参考应用的关系字段没有成立。
There is no error shown either on the screen or on log file. However when I check my app template on my workspace, the reference app to the relationship field is not set up.
所以,如果有人能告诉什么地方错了我的设置,这将是很好:)
So, if anybody could tell what's wrong with my settings, it would be nice :)
感谢大家。
推荐答案
的配置选项是在:的https: //developers.podio.com/doc/applications
设置名称不是应用
,但 referenced_apps
键,你可以一气呵成做到这一点。我们没有理由用3 API调用的时候,你可以用一个创建你的应用程序:
The settings name is not apps
but referenced_apps
and you can do this in one go. There's no reason to use 3 API calls when you can create your app with one:
$attributes = array(
"fields" => array(
array (
"type => "app",
"config" => array (
"label" => "Test field",
"settings" => array(
"referenced_apps" => array("app_id" => 10036463)
)
)
)
)
);
$app = new PodioApp($attributes);
这里
我省略了所有其他的应用程序属性。我也删除 EXTERNAL_ID
因为一个会为你自动生成。
I've omitted all the other app attributes here. I've also removed external_id
since one will be automatically generated for you.
这篇关于波迪奥:麻烦的关系应用领域的分配基准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!