Documentation

OrdersReturnQuery extends Base
in package

Class OrdersQuery.

Tags
author

Alexander Mahrt amahrt@leadcommerce.de

copyright

2016 LeadCommerce amahrt@leadcommerce.de

Table of Contents

$client  : ShopwareClient
$data  : array<string|int, mixed>
$methodsAllowed  : array<string|int, mixed>
$queryPath  : string
$total  : int
__construct()  : mixed
Base constructor.
create()  : Base
Creates an entity.
delete()  : array<string|int, mixed>|mixed
Deletes an entity by its id.
deleteBatch()  : array<string|int, mixed>|mixed
Deletes a batch of this entity given by ids.
findAll()  : array<string|int, Base>
Finds all entities.
findByParams()  : array<string|int, Base>
Finds entities by params.
findOne()  : Base
Finds an entity by its id.
getData()  : array<string|int, mixed>
getTotal()  : int
update()  : array<string|int, mixed>|mixed
Updates an entity.
updateBatch()  : array<string|int, Base>
Updates a batch of this entity.
createEntity()  : Base
Creates an entity based on the getClass method.
createEntityFromResponse()  : array<string|int, mixed>|Base
Creates an entity.
fetch()  : array<string|int, mixed>|mixed
Fetch and build entity.
fetchJson()  : false|stdClass
Fetch as json object.
fetchSimple()  : mixed|ResponseInterface
getClass()  : mixed
Gets the class for the entities.
getQueryPath()  : string
Gets the query path to look for entities.
validateMethodAllowed()  : mixed
Validates if the requested method is allowed.

Properties

$data

protected array<string|int, mixed> $data

$methodsAllowed

protected array<string|int, mixed> $methodsAllowed = [NetaShopwareSDKUtilConstants::METHOD_CREATE, NetaShopwareSDKUtilConstants::METHOD_GET, NetaShopwareSDKUtilConstants::METHOD_GET_BATCH, NetaShopwareSDKUtilConstants::METHOD_UPDATE, NetaShopwareSDKUtilConstants::METHOD_UPDATE_BATCH, NetaShopwareSDKUtilConstants::METHOD_DELETE, NetaShopwareSDKUtilConstants::METHOD_DELETE_BATCH]

$queryPath

protected string $queryPath

$total

protected int $total

Methods

__construct()

Base constructor.

public __construct( $client) : mixed
Parameters
$client :
Return values
mixed

create()

Creates an entity.

public create(Base $entity[, array<string|int, mixed> $params = [] ]) : Base
Parameters
$entity : Base
$params : array<string|int, mixed> = []
Tags
throws
MethodNotAllowedException
Return values
Base

delete()

Deletes an entity by its id.

public delete(mixed $id[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|mixed

.

Parameters
$id : mixed
$params : array<string|int, mixed> = []
Tags
throws
MethodNotAllowedException
Return values
array<string|int, mixed>|mixed

deleteBatch()

Deletes a batch of this entity given by ids.

public deleteBatch(array<string|int, mixed> $ids[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|mixed
Parameters
$ids : array<string|int, mixed>
$params : array<string|int, mixed> = []
Tags
throws
MethodNotAllowedException
Return values
array<string|int, mixed>|mixed

findAll()

Finds all entities.

public findAll() : array<string|int, Base>
Return values
array<string|int, Base>

findByParams()

Finds entities by params.

public findByParams(array<string|int, mixed> $params) : array<string|int, Base>

e.g.:

$params = [ 'limit' => 10, 'start' => 20, 'sort' => [ [ 'property' => 'name', 'direction' => 'ASC' ] ], 'filter' => [ [ 'property' => 'name', 'expression' => 'LIKE', 'value' => '%foo' ], [ 'operator' => 'AND', 'property' => 'number', 'expression' => '>', 'value' => '500' ] ] ]

Parameters
$params : array<string|int, mixed>
Return values
array<string|int, Base>

findOne()

Finds an entity by its id.

public findOne(mixed $id[, array<string|int, mixed> $params = [] ]) : Base
Parameters
$id : mixed
$params : array<string|int, mixed> = []
Return values
Base

getData()

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTotal()

public getTotal() : int
Return values
int

update()

Updates an entity.

public update(Base $entity[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|mixed
Parameters
$entity : Base
$params : array<string|int, mixed> = []
Tags
throws
MethodNotAllowedException
Return values
array<string|int, mixed>|mixed

updateBatch()

Updates a batch of this entity.

public updateBatch(array<string|int, Base$entities[, array<string|int, mixed> $params = [] ]) : array<string|int, Base>
Parameters
$entities : array<string|int, Base>
$params : array<string|int, mixed> = []
Return values
array<string|int, Base>

createEntity()

Creates an entity based on the getClass method.

protected createEntity( $content) : Base
Parameters
$content :
Return values
Base

fetch()

Fetch and build entity.

protected fetch( $uri[, string $method = 'GET' ][, null $body = null ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $uriParams = [] ]) : array<string|int, mixed>|mixed
Parameters
$uri :
$method : string = 'GET'
$body : null = null
$headers : array<string|int, mixed> = []
$uriParams : array<string|int, mixed> = []
Return values
array<string|int, mixed>|mixed

fetchJson()

Fetch as json object.

protected fetchJson( $uri[, string $method = 'GET' ][, null $body = null ][, array<string|int, mixed> $headers = [] ]) : false|stdClass
Parameters
$uri :
$method : string = 'GET'
$body : null = null
$headers : array<string|int, mixed> = []
Return values
false|stdClass

fetchSimple()

protected fetchSimple( $uri[, string $method = 'GET' ][, null $body = null ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface
Parameters
$uri :
$method : string = 'GET'
$body : null = null
$headers : array<string|int, mixed> = []
Return values
mixed|ResponseInterface

getClass()

Gets the class for the entities.

protected getClass() : mixed
Return values
mixed

getQueryPath()

Gets the query path to look for entities.

protected getQueryPath() : string

E.G: 'variants' or 'articles'.

Return values
string

validateMethodAllowed()

Validates if the requested method is allowed.

private validateMethodAllowed( $method) : mixed
Parameters
$method :
Tags
throws
MethodNotAllowedException
Return values
mixed

Search results