private function _run() { if ($this->predefinedId) { $widgetCounter = $this->predefinedId; } else { $widgetCounter = Counter::getInstance()->getNext(); } /* update parameters in case of any changes */ foreach ($this->validParameters as $parameter) { if (isset($this->{$parameter})) { $this->parameters[$parameter] = $this->{$parameter}; } } global $baseUrl; $json = file_get_contents("{$baseUrl}/list-api.php?" . http_build_query($this->parameters)); $response = json_decode($json, true); $this->widget = new TListWidget($response, $widgetCounter); }