Salesking SDK file for read access to collections

since 1.0.0
package SalesKing PHP SDK

 Methods

magic method for mapping all kinds of method calls to addFilter

__call(string $method, array $args) : \SaleskingCollection

since 1.0.0

Parameters

$method

string

method name

$args

array

array of arguments

Exceptions

\BadMethodCallException

Returns

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

$config

array

returns A JSON encoded string of the collection items

__toString() : string

since 1.0.0

Returns

string

Add a new filter which shall be used when doing the request

addFilter(string $filter, mixed $value) : \SaleskingCollection

since 1.0.0

Parameters

$filter

string

$value

mixed

Exceptions

\SaleskingException

Returns

returns the current page number

getCurrentPage() : int

since 1.0.0

Returns

intcurrent page

Return current filters

getFilters() : array

since 1.0.0

Returns

arrayfilters

Returns the fetched items

getItems() : array

since 1.0.0

Returns

arrayItems

Return the number of entries which are gonna be fetched per request

getPerPage() : int

since 1.0.0

Returns

intNumber of entries per page to fetch

Get the current sorting direction

getSort() : string

since 1.0.0

Returns

stringsorting direction

Get the current property which is used to sort the entries when doing the request

getSortBy() : string

since 1.0.0

Returns

stringobject property

total number of collection items

getTotal() : int

since 1.0.0

Returns

inttotal items

returns total number of collection pages

getTotalPages() : int

since 1.0.0

Returns

inttotal pages

Returns current collection type

getType() : string

since 1.0.0

Returns

stringcollection type

Execute a request against the Salesking API to fetch the items

load(int $page) : \SaleskingCollection

since 1.0.0

Parameters

$page

int

page number to fetch

Exceptions

\SaleskingException

Returns

Set the number of entries which are gonna be fetched per request

perPage(int $number) : \SaleskingCollection

since 1.0.0

Parameters

$number

int

Number of entries

Exceptions

\SaleskingException

Returns

Set multiple filters at once

setFilters(array $filters) : \SaleskingCollection

since 1.0.0

Parameters

$filters

array

Exceptions

\SaleskingException

Returns

set object type

setType(string $type) 

since 1.0.0

Parameters

$type

string

collection type

Set the current sorting direction

sort(string $direction) : \SaleskingCollection

since 1.0.0

Parameters

$direction

string

Sorting direction - either ASC or DESC

Exceptions

\SaleskingException

Returns

Set the property which is used to sort the entries when doing a request

sortBy(string $property) : \SaleskingCollection

since 1.0.0

Parameters

$property

string

Exceptions

\SaleskingException

Returns

Validate collection filter and value

validateFilter(string $filter, mixed $value) : bool

since 1.0.0

Parameters

$filter

string

name of the filter

$value

mixed

filter value

Returns

bool

 Properties

 

parent object

$api : \Salesking

since 1.0.0
 

use autoload function

$autoload : boolean

since 1.0.0
 

current page

$current_page : int

since 1.0.0
 

collection filters

$filters : array

since 1.0.0
 

already fetched items

$items : array

since 1.0.0
 

number of items per page

$per_page : int

since 1.0.0
 

object schema

$schema : mixed

since 1.0.0
 

sorting direction

$sort : string

since 1.0.0
 

property to use for sorting

$sort_by : string

since 1.0.0
 

total items

$total_entries : int

since 1.0.0
 

total pages

$total_pages : int

since 1.0.0
 

collection type

$type : string

since 1.0.0