BrandService extends BrandService
in package
Uses ServiceTrait

This is the BrandService class.

Remember that a service is an extension of a SDK model that allows to add additional actions to a model request or create new methods to simplify some common requests. In this case, the BrandService extends the SDK\Services\BrandService.

Tags
see
BrandService::getBrandById()
see
BrandService::getBrandsByIdList()
see
BrandService::getBrandByPId()
see
BrandService::addGetBrandById()
see
BrandService::addGetBrandsByIdList()
see
BrandService::addGetBrandByPId()
see
BrandService

Table of Contents

addGetBrandById() This method adds the batch request to get the brand whose id matches the given one.  : void
addGetBrandByPId() This method adds the batch request to get the brand whose pId matches the given one.  : void
addGetBrandsByIdList() This method adds the batch request to get those brands whose id matches any of the given idList.  : void
buildElementCollection() This method returns and ElementCollection from the given data and class  : bool
generateParametersGroupFromArray() This method sets a parametersGroup object with the filters indicated in params (array key=>value).  : array<string|int, mixed>
getAllBrands() Returns all brands  : ElementCollection|null
getBrandById() This method returns the Dto of the brand whose id matches the given one.  : Brand|null
getBrandByPId() This method returns the Dto of the brand whose pId matches the given one.  : Brand|null
getBrandsByIdList() This method returns the Dtos of those brands whose id matches any of the given list.  : ElementCollection|null
validateParameterGroup() This method validates the given parametersGroup. Returns true if valid, false otherwise.  : bool
getAllElementCollectionItems() Returns all available items filtered with the given parameters  : ElementCollection|null

Methods

addGetBrandById()

This method adds the batch request to get the brand whose id matches the given one.

public addGetBrandById(BatchRequests $batchRequests, string $batchName, int $id) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$id : int
Return values
void

addGetBrandByPId()

This method adds the batch request to get the brand whose pId matches the given one.

public addGetBrandByPId(BatchRequests $batchRequests, string $batchName, string $pId) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$pId : string
Return values
void

addGetBrandsByIdList()

This method adds the batch request to get those brands whose id matches any of the given idList.

public addGetBrandsByIdList(BatchRequests $batchRequests, string $batchName, string $idList) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$idList : string
Return values
void

buildElementCollection()

This method returns and ElementCollection from the given data and class

public buildElementCollection(array<string|int, mixed> $data, string $class) : bool
Parameters
$data : array<string|int, mixed>
$class : string
Return values
bool

generateParametersGroupFromArray()

This method sets a parametersGroup object with the filters indicated in params (array key=>value).

public generateParametersGroupFromArray(ParametersGroup &$parametersGroup, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$parametersGroup : ParametersGroup
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

with the applied filters

getAllBrands()

Returns all brands

public getAllBrands([BrandParametersGroup $params = null ]) : ElementCollection|null
Parameters
$params : BrandParametersGroup = null

object with the needed filters to send to the API brands resource

Return values
ElementCollection|null

getBrandById()

This method returns the Dto of the brand whose id matches the given one.

public getBrandById(int $id) : Brand|null
Parameters
$id : int
Return values
Brand|null

getBrandByPId()

This method returns the Dto of the brand whose pId matches the given one.

public getBrandByPId(string $pId) : Brand|null
Parameters
$pId : string
Return values
Brand|null

getBrandsByIdList()

This method returns the Dtos of those brands whose id matches any of the given list.

public getBrandsByIdList(string $idList) : ElementCollection|null
Parameters
$idList : string
Return values
ElementCollection|null

validateParameterGroup()

This method validates the given parametersGroup. Returns true if valid, false otherwise.

public validateParameterGroup(ParametersGroup $parametersGroup) : bool
Parameters
$parametersGroup : ParametersGroup
Return values
bool

getAllElementCollectionItems()

Returns all available items filtered with the given parameters

protected getAllElementCollectionItems(string $elementClass, string $resource, ParametersGroup $params) : ElementCollection|null
Parameters
$elementClass : string
$resource : string
$params : ParametersGroup

object with the needed filters to send to the API resource

Return values
ElementCollection|null

Search results