Salesking SDK file for read/write access to objects

since 1.0.0
package SalesKing PHP SDK

 Methods

Constructor method which is used to set some config stuff and load the schema file

__construct(Salesking $api, array $config) 

since 1.0.0

Parameters

$api

\Salesking

API object

$config

array

configuration array

magic getter function to get object properties

__get(string $property) : mixed

since 1.0.0

Parameters

$property

string

Returns

mixed

magic setter function to set object data

__set(string $property, mixed $value) 

since 1.0.0

Parameters

$property

string

$value

mixed

Exceptions

\SaleskingException

converts object data to an JSON encoded string

__toString() : string

since 1.0.0

Returns

stringJSON-encoded object data

helper function to bind data to object

bind(array | object $data, array $map) : \SaleskingObject

since 1.0.0

Parameters

$data

arrayobject

$map

array

array("company" => "organisation") maps value of company to organisation

Exceptions

\SaleskingException

Returns

Deletes the current object

delete() : mixed

since 1.0.0

Exceptions

\SaleskingException

Returns

mixedresponse

Get Salesking API endpoint for a specific task

getEndpoint(string $rel) : object

since 1.0.0

Parameters

$rel

string

Exceptions

\SaleskingException

Returns

objectendpoint information

Fetch object type

getType() : string

since 1.0.0

Returns

stringobject type

load object data from Salesking

load(string $id) : \SaleskingObject

since 1.0.0

Parameters

$id

string

object id

Exceptions

\SaleskingException

Returns

Saves the current object to Salesking

save() : mixed

since 1.0.0

Exceptions

\SaleskingException

Returns

mixedresponse

set object type

setType(string $type) 

Parameters

$type

string

object type

Validate input values for the specified object property

validate(string $property, mixed $value) : bool

since 1.0.0

Parameters

$property

string

$value

mixed

Returns

bool

 Properties

 

parent API object

$api : \Salesking

since 1.0.0
 

object data

$data : array

since 1.0.0
 

object schema

$schema : mixed

since 1.0.0
 

object type

$type : string

since 1.0.0