webservice = $webservice; } /** * @return array */ public function getFunctions() { return array( new \Twig_SimpleFunction('remote_client', array($this, 'getClient')), ); } /** * @param int $clientId * @return string */ public function getClient($clientId) { $client = $this->webservice->getArray('client', array( 'id' => $clientId )); return isset($client[0]) ? "{$client[0]['id']} - {$client[0]['name']}" : $clientId; } /** * @return string */ public function getName() { return 'remote_client_extension'; } }