PhysicalLocationsService
extends PhysicalLocationsService
in package
Uses
ServiceTrait
This is the PhysicalLocationsService 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 PhysicalLocationsService extends the SDK\Services\PhysicalLocationsService.
Tags
Table of Contents
addGetPhysicalLocationsByCountryId() | This method adds the batch request to get the 'physical locations' whose countryId matches the given one. | : void |
---|---|---|
addGetPhysicalLocationsByLatitudeAndLongitude() | This method adds the batch request to get the 'physical locations' whose latitude and longitude matches the given ones. | : 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> |
getAllPhysicalLocations() | Returns all available physical locations filtered with the given parameters | : ElementCollection|null |
getPhysicalLocationsByCountryId() | This method returns the Dtos of the 'physical locations' whose countryId matches the given one. | : ElementCollection|null |
getPhysicalLocationsByLatitudeAndLongitude() | This method returns the Dtos of the 'physical locations' whose latitude and longitude matches the given ones. | : 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
addGetPhysicalLocationsByCountryId()
This method adds the batch request to get the 'physical locations' whose countryId matches the given one.
public
addGetPhysicalLocationsByCountryId(BatchRequests $batchRequests, string $batchName, int $countryId) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
- $countryId : int
Return values
void —addGetPhysicalLocationsByLatitudeAndLongitude()
This method adds the batch request to get the 'physical locations' whose latitude and longitude matches the given ones.
public
addGetPhysicalLocationsByLatitudeAndLongitude(BatchRequests $batchRequests, string $batchName, float $latitude, float $longitude) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
- $latitude : float
- $longitude : float
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
getAllPhysicalLocations()
Returns all available physical locations filtered with the given parameters
public
getAllPhysicalLocations([PhysicalLocationParametersGroup $physicalLocationParametersGroup = null ]) : ElementCollection|null
Parameters
- $physicalLocationParametersGroup : PhysicalLocationParametersGroup = null
Return values
ElementCollection|null —getPhysicalLocationsByCountryId()
This method returns the Dtos of the 'physical locations' whose countryId matches the given one.
public
getPhysicalLocationsByCountryId(int $countryId) : ElementCollection|null
Parameters
- $countryId : int
Return values
ElementCollection|null —getPhysicalLocationsByLatitudeAndLongitude()
This method returns the Dtos of the 'physical locations' whose latitude and longitude matches the given ones.
public
getPhysicalLocationsByLatitudeAndLongitude(float $latitude, float $longitude) : ElementCollection|null
Parameters
- $latitude : float
- $longitude : float
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