From 612ee8577f5f64b0e82fefb4ba7db09e7ec7b6a3 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 10 Apr 2014 12:31:47 +0300 Subject: Added $lang argument --- gsxlib.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gsxlib.php') diff --git a/gsxlib.php b/gsxlib.php index dfea4e3..b4eec45 100644 --- a/gsxlib.php +++ b/gsxlib.php @@ -32,7 +32,8 @@ class GsxLib $password, $environment = '', $region = 'emea', - $tz = 'CEST') + $tz = 'CEST', + $lang = 'en') { if(!(self::$_instance instanceof self)) { self::$_instance = new self( @@ -41,7 +42,8 @@ class GsxLib $password, $environment, $region, - $tz + $tz, + $lang ); } @@ -57,7 +59,8 @@ class GsxLib $password, $environment = '', $region = 'emea', - $tz = 'CEST' ) + $tz = 'CEST', + $lang = 'en' ) { if(!class_exists('SoapClient')) { throw new GsxException('Looks like your PHP lacks SOAP support'); @@ -110,7 +113,7 @@ class GsxLib 'userId' => $username, 'password' => $password, 'serviceAccountNo' => $account, - 'languageCode' => 'en', + 'languageCode' => $lang, 'userTimeZone' => $tz, ) ); @@ -124,7 +127,7 @@ class GsxLib if($environment == '2') $environment = 'production'; $error = 'Authentication with GSX failed. Does this account have access to ' - .$environment."?\n"; + .$environment." environment?\n"; throw new GsxException($error); } @@ -290,8 +293,7 @@ class GsxLib 'lookupRequestData' => $query )); - $response = $this->client->RepairLookup($req) - ->RepairLookupResponse; + $response = $this->client->RepairLookup($req)->RepairLookupResponse; return $response->lookupResponseData; } @@ -436,9 +438,7 @@ class GsxLib } - $req = array('PartsLookup' => array( - 'lookupRequestData' => $query - )); + $req = array('PartsLookup' => array('lookupRequestData' => $query)); $result = $this->request($req)->parts; // always return an array -- cgit v1.2.3