\Shopware\Components\Api\ResourceEorder

Extended Order API Resource.

Performs all the API operations on Order records. Extends Shopwares REST API Order.

Summary

Methods
Properties
Constants
getRepository()
getIdFromNumber()
getOneByNumber()
getOne()
getList()
updateByNumber()
update()
prepareOrderData()
prepareOrderDetailsData()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getRepository()

getRepository() : \Doctrine\ORM\EntityRepository

Loads repository class for the Order resource.

Returns

\Doctrine\ORM\EntityRepository

getIdFromNumber()

getIdFromNumber(string  $number) : integer

Little helper function for the getOneByNumber method.

Gets the Order id from the Order number.

Parameters

string $number

Order number to get its Id.

Throws

\Shopware\Components\Api\Exception\NotFoundException
\Shopware\Components\Api\Exception\ParameterMissingException

Returns

integer

getOneByNumber()

getOneByNumber(string  $number) : array|\Shopware\Models\Order\Order

Fetches Order details based on Order number.

Parameters

string $number

Order number to get its details.

Throws

\Shopware\Components\Api\Exception\ParameterMissingException
\Shopware\Components\Api\Exception\NotFoundException

Returns

array|\Shopware\Models\Order\Order

getOne()

getOne(integer  $id) : array|\Shopware\Models\Order\Order

Fetches Order details based on Order Id.

Parameters

integer $id

Order Id to get its details.

Throws

\Shopware\Components\Api\Exception\ParameterMissingException
\Shopware\Components\Api\Exception\NotFoundException

Returns

array|\Shopware\Models\Order\Order

getList()

getList(integer  $offset, integer  $limit = 25, array  $criteria = array(), array  $orderBy = array()) : array

Fetches all the Order details.

Parameters

integer $offset

offset to fetch the Order list.

integer $limit

limit to fetch the Order list.

array $criteria

criteria to fetch the Order list.

array $orderBy

orderby field to fetch the Order list in a specified order.

Returns

array

updateByNumber()

updateByNumber(string  $number, array  $params) : \Shopware\Models\Order\Order

Updates Order details based on Order number.

Parameters

string $number

Order number to update its details.

array $params

data to be updated.

Throws

\Shopware\Components\Api\Exception\ValidationException
\Shopware\Components\Api\Exception\NotFoundException
\Shopware\Components\Api\Exception\ParameterMissingException

Returns

\Shopware\Models\Order\Order

update()

update(integer  $id, array  $params) : \Shopware\Models\Order\Order

Updates Order details based on Order Id.

Parameters

integer $id

Order Id to update its details.

array $params

data to be updated.

Throws

\Shopware\Components\Api\Exception\ValidationException
\Shopware\Components\Api\Exception\NotFoundException
\Shopware\Components\Api\Exception\ParameterMissingException

Returns

\Shopware\Models\Order\Order

prepareOrderData()

prepareOrderData(array  $params) : array

Helper method to prepare the order data.

Parameters

array $params

Data to be formatted/prepared.

Throws

\Shopware\Components\Api\Exception\NotFoundException

Returns

array

prepareOrderDetailsData()

prepareOrderDetailsData(array  $params) : mixed

Helper method to prepare the order details data

Parameters

array $params

Data to be formatted/prepared.

Throws

\Shopware\Components\Api\Exception\NotFoundException

ApiException\CustomValidationException(

Returns

mixed