Filtering app items by contact field
AnsweredI'm trying to write a PHP script which get all the items assigned to the logged in user. I retrieved the contact object using PodioContact::get_for_user( ) and provided it as input to the filters as follows(the external_id of the field is "responsible":
$user_contact = PodioContact::get_for_user( $user_id );
$t_attributes = array(
'filters' => array('responsible'=> $user_contact),
);
...
...
$t_items = PodioItem::filter( $t_app->id, $t_attributes);
But it seems the it's not the right way to implement this. Could someone please guide me in the correct direction? Basically, I would like to retrieve all items based on the responsible field(which is of type Contact).
Thanks in advance.
Please sign in to leave a comment.
Comments
2 comments