/** * Fetch any child items of a particular item * * @param Item $item * @return array $fetchedItems */ public function fetchItemChildren($item) { $itemKey = ApiObject::extractKey($item); $aparams = array('target' => 'children', 'itemKey' => $itemKey); $response = $this->request($aparams, 'GET'); //load response into item objects $fetchedItems = array(); if ($response->isError()) { return false; throw new Exception("Error fetching items"); } $respArray = $response->parseResponseBody(); return $this->items->addItemsFromJson($respArray); }