Update app relationship
Hi, I'm updating a relationship field and i can't get it to work. This is my code:
$attributes = array(
"client" => $reference_id
);
$options = array(
"hook" => false,
"silent" => true
);
PodioItemField::update( $_POST['item_id'], 'XXXXXXX', $attributes, $options );
Feels like I'm making a stupid misstake.
-
I updated it to this and it wont save, cant see why:
$item = PodioItem::get($_POST['item_id']);
if (!isset($item->fields['client'])) { $item->fields['client'] = new PodioAppItemField(); } $item->fields['client']->values = array( array('item_id' => $reference_id) ); $item->save(array( 'hook' => false, 'silent' => true ));
External id is client.
-
You can see examples for all field types at: http://podio.github.io/podio-php/fields/ (provided you are using the latest version 4.x of podio-php).
/Andreas
-
this is a broken link, can you update?
-
This is the updated link : https://podio-community.github.io/podio-php/
Please sign in to leave a comment.
Comments
6 comments