BannerService
extends BannerService
in package
Uses
ServiceTrait
This is the BannerService 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 BannerService extends the SDK\Services\BannerService.
Tags
Table of Contents
addGetBannerById() | This method adds the batch request to get the banner whose id matches the given one. | : void |
---|---|---|
addGetBannerByPId() | This method adds the batch request to get the banner whose pId matches the given one. | : void |
addGetBannersByIdList() | This method adds the batch request to get those banners whose id matches any of the given idList. | : void |
addGetBannersByPosition() | This method adds the batch request to get those banners whose position matches the given one. | : void |
addGetBannersByPositionList() | This method adds the batch request to get those banners whose position 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> |
getBannerById() | This method returns the Dto of the banner whose id matches the given one. | : Banner|null |
getBannerByPId() | This method returns the Dto of the banner whose pId matches the given one. | : Banner|null |
getBannersByIdList() | This method returns the Dtos of those banners whose id matches any of the given list. | : ElementCollection|null |
getBannersByPosition() | This method returns the Dtos of those banners whose position matches the given one. | : ElementCollection|null |
getBannersByPositionList() | This method returns the Dtos of those banners whose position 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
addGetBannerById()
This method adds the batch request to get the banner whose id matches the given one.
public
addGetBannerById(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 —addGetBannerByPId()
This method adds the batch request to get the banner whose pId matches the given one.
public
addGetBannerByPId(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 —addGetBannersByIdList()
This method adds the batch request to get those banners whose id matches any of the given idList.
public
addGetBannersByIdList(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 —addGetBannersByPosition()
This method adds the batch request to get those banners whose position matches the given one.
public
addGetBannersByPosition(BatchRequests $batchRequests, string $batchName, int $position) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $position : int
Return values
void —addGetBannersByPositionList()
This method adds the batch request to get those banners whose position matches any of the given idList.
public
addGetBannersByPositionList(BatchRequests $batchRequests, string $batchName, string $positionList) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $positionList : 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
getBannerById()
This method returns the Dto of the banner whose id matches the given one.
public
getBannerById(int $id) : Banner|null
Parameters
- $id : int
Return values
Banner|null —getBannerByPId()
This method returns the Dto of the banner whose pId matches the given one.
public
getBannerByPId(string $pId) : Banner|null
Parameters
- $pId : string
Return values
Banner|null —getBannersByIdList()
This method returns the Dtos of those banners whose id matches any of the given list.
public
getBannersByIdList(string $idList) : ElementCollection|null
Parameters
- $idList : string
Return values
ElementCollection|null —getBannersByPosition()
This method returns the Dtos of those banners whose position matches the given one.
public
getBannersByPosition(int $position) : ElementCollection|null
Parameters
- $position : int
Return values
ElementCollection|null —getBannersByPositionList()
This method returns the Dtos of those banners whose position matches any of the given list.
public
getBannersByPositionList(string $positionList) : ElementCollection|null
Parameters
- $positionList : 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