
Anonymous Community User asked a question.
Only get a few values out off podio
Hi. Im a developing a google map that takes values from a Podio app. The idea seems to work, but somehow I am not getting all the items out of the Podio app. I've got 60 and I only get an array size off 20. What's the problem here? Here's my podio connect class. <?php /*this Class is making connection with the podio API just include podio_connect.php in your script and you kan satr interacting with Podio*/ require_once 'podio-php/PodioAPI.php'; class podio_connect { public $allItems=array(); public $itemArray=array(); public $allValue=array(); private $allExteral_ids=array(); public $app_id; public $app_token; public $client_id; public $client_secret; //constructor for connecting with podio when creating the object function podio_connect($app_id,$app_token, $client_id,$client_secret){ $this->app_id=$app_id; $this->app_token=$app_token; $this->client_id=$client_id; $this->client_secret=$client_secret; $this->setupConection($client_id,$client_secret); } function setupConection($client_id,$client_secret){ Podio::setup($this->client_id, $this->client_secret); try { Podio::authenticate('app', array('app_id' => $this->app_id, 'app_token' => $this->app_token)); } catch (PodioError $e) { } } public function getFieldValue($app_id,$external_id){ $items = PodioItem::filter($this->app_id); $items = $items['items']; for($i=0;$i<count($items);$i++){ $itemArray[$i]=$items[$i]->item_id; } for($j=0;$j<count($itemArray);$j++){ $item=PodioItem::get($itemArray[$j]); $field=$item->field($external_id); $value=$field->humanized_value(); $values[$j]= $value; } return $values; } public function getExternalId_values($allExteral_ids){ $items = PodioItem::filter($this->app_id); $item = $items['items']; echo count($item); for($i=0;$i<count($item);$i++){ $itemArray[$i]=$item[$i]->item_id; } for($j=0;$j<count($itemArray);$j++){ $podioItem=PodioItem::get($itemArray[$j]); $field=$podioItem->field($allExteral_ids[0]); $field1=$podioItem->field($allExteral_ids[1]); $field2=$podioItem->field($allExteral_ids[2]); $field3=$podioItem->field('lat2'); $field4=$podioItem->field('lng3'); $field5=$podioItem->field($allExteral_ids[5]); $field6=$podioItem->field($allExteral_ids[6]); $field7=$podioItem->field($allExteral_ids[7]); $value=$field->humanized_value(); $value1=$field1->humanized_value(); $value2=$field2->humanized_value(); $value3=$field3->humanized_value(); $value4=$field4->humanized_value(); $value5=$field5->humanized_value(); $value6=$field6->humanized_value(); $value7=$field7->humanized_value(); $allValue[$j]=$value; $allValue[$j+1]=$value1; $allValue[$j+2]=$value2; $allValue[$j+3]=$value3; $allValue[$j+4]=$value4; $allValue[$j+5]=$value5; $allValue[$j+6]=$value6; $allValue[$j+7]=$value7; $allItems[$j]=$allValue; } return $allItems; } } ?>