I am reviewing the sample code in /examples/items.php, and I don't see examples of how to set some of the more complex PodioItemFields such as Embed fields and Reference fields...
Would it be possible to have this updated with examples of every PodioItemField type?
I am speaking specifically about how to work to call set_value for these field types...
For example, I am trying to update the value of an "embed" field (a link field) and I am calling code similar to:
$attributes = array( 'url' => 'http://www.infranet.com' );
$embed = PodioEmbed::create( $attributes );
$this->orgItem->field( 'organizationlink' )->set_value( $embed->embed_id );
(I also tried
$this->orgItem->field( 'organizationlink' )->set_value( $embed );
The creation of the "embed" is working fine... I get this error on the set_value() call...
If the PodioItem I am trying to update has no value in the 'organizationlink' field, I get this error:
Call to a member function set_value() on a non-object
This is happening because the orgItem that was returned from Podio when I called PodioItem::filter didn't contain any value for the 'organizationlink' field...
Why doesn't set_value() take care of this and create the new 'field'? What do I have to do to update this field and then what is proper way to embed a link in the embed field type?
Please sign in to leave a comment.