TrackerService
extends TrackerService
in package
Uses
ServiceTrait
This is the TrackerService 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 TrackerService extends the SDK\Services\TrackerService.
Tags
Table of Contents
addGetTrackersByPageType() | This method adds the batch request to get those trackers whose pageType matches the given one. | : void |
---|---|---|
addGetTrackersByRouteType() | This method adds the batch request to get those trackers whose routeType matches the given one. | : void |
addGetTrackersByRouteTypeAndPageType() | This method adds the batch request to get those trackers whose routeType and pageType match the given one. | : 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> |
getTrackersByPageType() | This method returns the Dtos of those trackers whose pageType matches the given one. | : ElementCollection|null |
getTrackersByRouteType() | This method returns the Dtos of those trackers whose routeType matches the given one. | : ElementCollection|null |
getTrackersByRouteTypeAndPageType() | This method returns the Dtos of those trackers whose routeType and pageType match the given one. | : ElementCollection|null |
isTrackableRouteType() | This method returns if the routeType given is trackeable. | : bool |
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
addGetTrackersByPageType()
This method adds the batch request to get those trackers whose pageType matches the given one.
public
addGetTrackersByPageType(BatchRequests $batchRequests, string $batchName, string $pageType) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $pageType : string
Return values
void —addGetTrackersByRouteType()
This method adds the batch request to get those trackers whose routeType matches the given one.
public
addGetTrackersByRouteType(BatchRequests $batchRequests, string $batchName, string $routeType) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $routeType : string
Return values
void —addGetTrackersByRouteTypeAndPageType()
This method adds the batch request to get those trackers whose routeType and pageType match the given one.
public
addGetTrackersByRouteTypeAndPageType(BatchRequests $batchRequests, string $batchName, string $pageType, string $routeType) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $pageType : string
- $routeType : 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
getTrackersByPageType()
This method returns the Dtos of those trackers whose pageType matches the given one.
public
getTrackersByPageType(string $pageType) : ElementCollection|null
Parameters
- $pageType : string
Return values
ElementCollection|null —getTrackersByRouteType()
This method returns the Dtos of those trackers whose routeType matches the given one.
public
getTrackersByRouteType(string $routeType) : ElementCollection|null
Parameters
- $routeType : string
Return values
ElementCollection|null —getTrackersByRouteTypeAndPageType()
This method returns the Dtos of those trackers whose routeType and pageType match the given one.
public
getTrackersByRouteTypeAndPageType(string $pageType, string $routeType) : ElementCollection|null
Parameters
- $pageType : string
- $routeType : string
Return values
ElementCollection|null —isTrackableRouteType()
This method returns if the routeType given is trackeable.
public
static isTrackableRouteType(string $routeType) : bool
Parameters
- $routeType : string
Return values
bool —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