I am trying to create new items in four apps apps via one form -- some the items will become app references. For example, I first create an Entity item, then a Person item and relate the new Entity to the Person via an app reference field in the Person App. Then create a Project and relate both the Person and the Entity to the Project. This was successful until I upgraded to the latest Podio-PHP. In the past, when newly created items were returning item_id as integer then I could pass that into the field as an app reference before the next item was created.
I've been trying to get the item_id as integer so I can do the same, but I keep getting null. Anyway, given the way Podio now returns newly created items as objects, should I be trying this a different way?
$app_id = 1234567;
$fields = new PodioItemFieldCollection(array(
...I am defining external_id and values...
));
$item = new PodioItem(array(
'app' => new PodioApp($app_id),
'fields' => $fields,
));
if( $files ){
$item->files = new PodioCollection($files);
};
$item->save();
$new_id = $item->item_id;
return $new_id;
$new_id is where I'm trying to store the integer so I can pass it along to the next item creation as an app reference.