\Shopware\Components\Api\ResourceUser

User API Resource.

Performs all the API operations on User records. Extends Shopwares REST API Resource.

Summary

Methods
Properties
Constants
getRepository()
getOne()
getList()
create()
update()
delete()
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() : \Shopware\Models\User\Repository

Loads repository class for the User resource.

Returns

\Shopware\Models\User\Repository

getOne()

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

Fetches User details based on User Id.

Parameters

integer $id

User Id to get its details.

Throws

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

Returns

array|\Shopware\Models\User\User

getList()

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

Fetches all the User details.

Parameters

integer $offset

offset to fetch the User list.

integer $limit

limit to fetch the User list.

array $criteria

criteria to fetch the User list.

array $orderBy

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

Returns

array

create()

create(array  $params) : \Shopware\Models\User\User

Creates a new User record.

Parameters

array $params

data for the User to be created.

Throws

\Shopware\Components\Api\Exception\CustomValidationException
\Shopware\Components\Api\Exception\ValidationException
\Exception

Returns

\Shopware\Models\User\User

update()

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

Updates User details based on User Id.

Parameters

integer $id

User 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
\Shopware\Components\Api\Exception\CustomValidationException

Returns

\Shopware\Models\User\User

delete()

delete(integer  $id) : \Shopware\Models\User\User

Deletes User details based on User Id.

Parameters

integer $id

User Id to delete its details.

Throws

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

Returns

\Shopware\Models\User\User