RegionService
extends VultrService
in package
Region service handler, for all regions endpoints.
Tags
Table of Contents
Properties
- $vultr : VultrClient
- $cache_region : array<string|int, mixed>|null
- $client : VultrClientHandler
Methods
- __construct() : mixed
- cacheRegions() : void
- Cache all regions from the vultr api.
- getAvailablility() : array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>
- Get a list of the available plans in the region.
- getRegion() : Region|null
- Get a specific region object based on the region id
- getRegions() : array<string|int, Region>
- List all regions at vultr
- createObject() : ModelInterface
- deleteObject() : void
- getClientHandler() : VultrClientHandler
- getListObjects() : array<string|int, ModelInterface>
- getObject() : ModelInterface
- getVultrClient() : VultrClient
- list() : array<string|int, mixed>
- patchObject() : void
- getReadableClassType() : string
Properties
$vultr
protected
VultrClient
$vultr
$cache_region
private
static array<string|int, mixed>|null
$cache_region
= null
$client
private
VultrClientHandler
$client
Methods
__construct()
public
__construct(VultrClient $vultr, VultrClientHandler $client) : mixed
Parameters
- $vultr : VultrClient
- $client : VultrClientHandler
cacheRegions()
Cache all regions from the vultr api.
public
cacheRegions([ $override = false ]) : void
Parameters
Tags
getAvailablility()
Get a list of the available plans in the region.
public
getAvailablility( $id[, $type = null ]) : array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>
Parameters
- $id :
-
- string - Ex ewr - Id of the region
- $type : = null
-
- string|null - PlanService Filters - FILTER_ALL, FILTER_VC2, FILTER_VHF, FILTER_VDC, FILTER_VBM
Tags
Return values
array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>getRegion()
Get a specific region object based on the region id
public
getRegion( $id) : Region|null
Parameters
Tags
Return values
Region|nullgetRegions()
List all regions at vultr
public
getRegions([ &$options = null ]) : array<string|int, Region>
Parameters
Tags
Return values
array<string|int, Region>createObject()
protected
createObject( $uri, $model, $params) : ModelInterface
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are creating
- $params :
-
- array - The values that we will be sending. Refactor to use getUpdateParams/getUpdateArray?
Tags
Return values
ModelInterfacedeleteObject()
protected
deleteObject( $uri, $model) : void
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are acting on deleting. This doesn't need to be a fully initialized object.
Tags
getClientHandler()
protected
getClientHandler() : VultrClientHandler
Return values
VultrClientHandlergetListObjects()
protected
getListObjects( $uri, $model[, &$options = null ][, $params = null ]) : array<string|int, ModelInterface>
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object that will be mapped to the get response.
- $options : = null
-
- ListOptions - Pagination object
- $params : = null
-
- array - filter parameters.
Tags
Return values
array<string|int, ModelInterface>getObject()
protected
getObject( $uri, $model) : ModelInterface
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object that will be mapped to the get response.
Tags
Return values
ModelInterfacegetVultrClient()
protected
getVultrClient() : VultrClient
Return values
VultrClientlist()
protected
list(string $uri, ModelInterface $model, ListOptions &$options[, array<string|int, mixed>|null $params = null ]) : array<string|int, mixed>
Parameters
- $uri : string
- $model : ModelInterface
- $options : ListOptions
- $params : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>patchObject()
protected
patchObject( $uri, $model[, array<string|int, mixed>|null $params = null ]) : void
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are updating. This needs to be a fully initialized object.
- $params : array<string|int, mixed>|null = null
Tags
getReadableClassType()
private
getReadableClassType(ModelInterface $model) : string
Parameters
- $model : ModelInterface