im supposed to use get item values but it is not in podio-php client, and i have little to no experience with api
i have looked around and found a work around getting all the item id on app then looping through all the id and all the fields in the app problem is, its very slow, so am i doing something wrong?
here's some of my code
foreach ($item_collection['items'] as $item_key => $item) {
$pname[] = (\PodioItem::get_field_value($item->item_id, 46702393));
$channel[] = (\PodioItem::get_field_value($item->item_id, 46702394));
and i have like more than 30 ids and 17 or so fields
PS: im using symfony2
Since you have already gotten an item collection there's no need for any more API requests. When you call PodioItem::get_field_value() inside a loop like that it will be extremely slow because you are making a request to a remote server.
In this case it's unnecessary because you already have all the data. $item
contains all the field values:
foreach ($item_collection['items'] as $item_key => $item) {
$pname[] = $item->field(46702393);
$channel[] = $item->field(46702394);
$pname and $channel now contains an array of PodioItemField objects that you can work on.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.