NetSuiteClient
in package
Table of Contents
- $client : SoapClient
- $clientOptions : array<string|int, mixed>
- $config : array<string|int, mixed>
- $logger : Logger
- $soapHeaders : array<string|int, mixed>
- __construct() : mixed
- addHeader() : mixed
- Add a header by name.
- clearHeader() : mixed
- Remove a header by name.
- clearPreferences() : mixed
- Clear preferences header.
- clearSearchPreferences() : mixed
- Clear the search preferences.
- createFromEnv() : NetSuiteClient
- Alternate way to instantiate the NetSuiteClient. This method is superfluous now that the constructor will intelligently look for ENV configuration when it isn't given explicit configuration. This static method is retained for compatibility with those users who might currently be using this method.
- getClient() : SoapClient
- Get the current soap client.
- getEnvConfig() : array<string|int, mixed>
- Create a configuration array by inspecting the $_ENV superglobal.
- logRequests() : mixed
- Turn request logging on or off.
- setApplicationInfo() : mixed
- Set the application id.
- setDataCenterUrl() : void
- Set the data center URL for the configured NetSuite account
- setLogPath() : mixed
- Set the logging path.
- setPreferences() : mixed
- Set preferences header.
- setSearchPreferences() : mixed
- Set the search preferences header.
- validateConfig() : void
- Make sure that this client object has at least the basic required configuration values defined or else throw a runtime exception.
- makeSoapCall() : mixed
- Make the SOAP call!
- computeTokenPassportSignature() : string
- Compute TokenPassport signature
- createOptions() : array<string|int, mixed>
- Create the options array.
- createPassportFromConfig() : Passport
- Create the Passport.
- createTokenPassportFromConfig() : TokenPassport
- Create the TokenPassport.
- createWsdl() : string
- Build the WSDL address from the config.
- fixWtfCookieBug() : mixed
- SoapClient apparently always sends the JSESSIONID cookie.
- generateTokenPassportNonce() : mixed
- Generate random (or sufficiently enough so) string of characters
- logSoapCall() : mixed
- Log the last SOAP call.
Properties
$client
private
SoapClient
$client
$clientOptions
private
array<string|int, mixed>
$clientOptions
= []
$config
private
array<string|int, mixed>
$config
$logger
private
Logger
$logger
$soapHeaders
private
array<string|int, mixed>
$soapHeaders
= []
Methods
__construct()
public
__construct([array<string|int, mixed> $config = null ][, array<string|int, mixed> $options = [] ][, SoapClient $client = null ]) : mixed
Parameters
- $config : array<string|int, mixed> = null
- $options : array<string|int, mixed> = []
- $client : SoapClient = null
Return values
mixed —addHeader()
Add a header by name.
public
addHeader(string $header, mixed $value) : mixed
Parameters
- $header : string
- $value : mixed
Return values
mixed —clearHeader()
Remove a header by name.
public
clearHeader(string $header) : mixed
Parameters
- $header : string
Return values
mixed —clearPreferences()
Clear preferences header.
public
clearPreferences() : mixed
Return values
mixed —clearSearchPreferences()
Clear the search preferences.
public
clearSearchPreferences() : mixed
Return values
mixed —createFromEnv()
Alternate way to instantiate the NetSuiteClient. This method is superfluous now that the constructor will intelligently look for ENV configuration when it isn't given explicit configuration. This static method is retained for compatibility with those users who might currently be using this method.
public
static createFromEnv([array<string|int, mixed> $options = [] ][, SoapClient $client = null ]) : NetSuiteClient
This method will be removed in some future version.
Parameters
- $options : array<string|int, mixed> = []
- $client : SoapClient = null
Tags
Return values
NetSuiteClient —getClient()
Get the current soap client.
public
getClient() : SoapClient
Tags
Return values
SoapClient —getEnvConfig()
Create a configuration array by inspecting the $_ENV superglobal.
public
static getEnvConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —logRequests()
Turn request logging on or off.
public
logRequests([bool $on = true ]) : mixed
Parameters
- $on : bool = true
Return values
mixed —setApplicationInfo()
Set the application id.
public
setApplicationInfo([string $appId = null ]) : mixed
Parameters
- $appId : string = null
Return values
mixed —setDataCenterUrl()
Set the data center URL for the configured NetSuite account
public
setDataCenterUrl(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
Return values
void —setLogPath()
Set the logging path.
public
setLogPath(string $logPath) : mixed
Parameters
- $logPath : string
Return values
mixed —setPreferences()
Set preferences header.
public
setPreferences([bool $warningAsError = false ][, bool $disableMandatoryCustomFieldValidation = false ][, bool $disableSystemNotesForCustomFields = false ][, bool $ignoreReadOnlyFields = false ]) : mixed
Parameters
- $warningAsError : bool = false
- $disableMandatoryCustomFieldValidation : bool = false
- $disableSystemNotesForCustomFields : bool = false
- $ignoreReadOnlyFields : bool = false
Return values
mixed —setSearchPreferences()
Set the search preferences header.
public
setSearchPreferences([bool $bodyFieldsOnly = true ][, int $pageSize = 50 ][, bool $returnSearchColumns = true ]) : mixed
Parameters
- $bodyFieldsOnly : bool = true
- $pageSize : int = 50
- $returnSearchColumns : bool = true
Return values
mixed —validateConfig()
Make sure that this client object has at least the basic required configuration values defined or else throw a runtime exception.
public
validateConfig(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
Return values
void —makeSoapCall()
Make the SOAP call!
protected
makeSoapCall(string $operation, mixed $parameter) : mixed
Parameters
- $operation : string
- $parameter : mixed
Return values
mixed —computeTokenPassportSignature()
Compute TokenPassport signature
private
computeTokenPassportSignature(int|string $account, string $consumerKey, mixed $consumerSecret, string $token, string $tokenSecret, string $nonce, int|string $timestamp, string $signatureAlgorithm) : string
Parameters
- $account : int|string
- $consumerKey : string
- $consumerSecret : mixed
- $token : string
- $tokenSecret : string
- $nonce : string
- $timestamp : int|string
- $signatureAlgorithm : string
Return values
string —createOptions()
Create the options array.
private
createOptions(array<string|int, mixed> $config[, array<string|int, mixed> $overrides = [] ]) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed>
- $overrides : array<string|int, mixed> = []
Return values
array<string|int, mixed> —createPassportFromConfig()
Create the Passport.
private
createPassportFromConfig(array<string|int, mixed> $config) : Passport
Parameters
- $config : array<string|int, mixed>
Return values
Passport —createTokenPassportFromConfig()
Create the TokenPassport.
private
createTokenPassportFromConfig(array<string|int, mixed> $config) : TokenPassport
Parameters
- $config : array<string|int, mixed>
Return values
TokenPassport —createWsdl()
Build the WSDL address from the config.
private
createWsdl(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Return values
string —fixWtfCookieBug()
SoapClient apparently always sends the JSESSIONID cookie.
private
fixWtfCookieBug() : mixed
So we'll just un-set it to prevent this.
Return values
mixed —generateTokenPassportNonce()
Generate random (or sufficiently enough so) string of characters
private
generateTokenPassportNonce([mixed $length = 32 ]) : mixed
Parameters
- $length : mixed = 32
Return values
mixed —logSoapCall()
Log the last SOAP call.
private
logSoapCall(string $operation) : mixed
Parameters
- $operation : string