protected function getApi($id) { $url = Core::$API_HOST . "item/{$id}"; $url = Core::urlAddKey($url); $this->curl->get($url); $json = $this->curl->response; $jArray = json_decode($json, true); if (isset($jArray['status']) && $jArray['status'] == 'nok') { //Status error, update current item to reflect, and return $this->_empty(); $this->data['lastUpdate'] = null; $this->data['fullJSON'] = $json; $this->site->debug->notice("wowItem({$id}) does not exist"); return null; } foreach ($jArray as $key => $value) { parent::__set($key, $value); } $this->data['lastUpdate'] = time(); $this->data['fullJSON'] = $json; $this->saveItem(); //$this->saveIcon(); $this->site->debug->notice("Updated Item({$id}) from API"); }