webservice = $webservice; } /** * @return array */ public function getFunctions() { return array( new \Twig_SimpleFunction('get_json', array($this, 'getJSON')), ); } /** * @param int $clientId * * @return string */ public function getJSON($parameter = 'client', $filters = []) { $url = $this->webservice->buildUrl($parameter, $filters); return current(json_decode($this->webservice->makeGetRequest($url), true)); } /** * @return string */ public function getName() { return 'get_json_extension'; } }