\OpenResourceManager\ClientAddresses

ORM Address Client

Communicates with an ORM API to preform address operations.

Summary

Methods
Properties
Constants
__construct()
getORM()
getPage()
setPage()
addPage()
subPage()
getList()
get()
delete()
getForAccount()
getForIdentifier()
getForUsername()
store()
No public properties found
No constants found
urlFromRoute()
_get()
_post()
_patch()
_del()
getFromCode()
deleteFromCode()
deleteFromIdentifier()
deleteFromUsername()
$baseURL
$route
$page
$orm
$validCodes
N/A
No private methods found
No private properties found
N/A

Properties

$baseURL

$baseURL : null|array

Base API URL

Base API URL comprised of environment variables passed to the ORM constructor.

Type

null|array

$route

$route : string

Base Address Route

The base API route for the address client.

Type

string

$page

$page : integer

Results Page

The page of results to get.

Type

integer

$orm

$orm : null|\OpenResourceManager\ORM

ORM Connection

The current ORM connection.

Type

null|\OpenResourceManager\ORM

$validCodes

$validCodes : null|array

Valid Response Codes

Response codes that are used to determine if the api request was a success.

Type

null|array

Methods

__construct()

__construct(\OpenResourceManager\ORM  $orm) 

Client Constructor

Constructs a client.

Parameters

\OpenResourceManager\ORM $orm

getORM()

getORM() : \OpenResourceManager\ORM

Get ORM Connection

Returns the current ORM object

Returns

\OpenResourceManager\ORM

getPage()

getPage() : integer

Get Page

Returns the current page

Returns

integer

setPage()

setPage(integer  $page = 1) 

Set Page

Sets the target page.

Parameters

integer $page

addPage()

addPage(integer  $page = 1) 

Add Page

Adds to the target page.

Parameters

integer $page

subPage()

subPage(integer  $page = 1) 

Subtract Page

Sets the target page back.

Parameters

integer $page

getList()

getList() : \Unirest\Response

Get Address List

Gets a list of addresses.

Returns

\Unirest\Response

get()

get(integer  $id) : \Unirest\Response

Get Address

Gets an address by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

delete()

delete(integer  $id) : \Unirest\Response

Delete Address

Delete an address by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

getForAccount()

getForAccount(integer  $id) : \Unirest\Response

Get Addresses Owned By Account

Get a list of addresses owned by an account by supplying it's ID.

Parameters

integer $id

Returns

\Unirest\Response

getForIdentifier()

getForIdentifier(string  $identifier) : \Unirest\Response

Get Addresses Owned By Account From Identifier

Get a list of addresses owned by an account by supplying it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

getForUsername()

getForUsername(string  $username) : \Unirest\Response

Get Addresses Owned By Account From Username

Get a list of addresses owned by an account by supplying it's username.

Parameters

string $username

Returns

\Unirest\Response

store()

store(integer  $account_id = null, string  $identifier = null, string  $username = null, string  $addressee = null, string  $organization = null, string  $line_1 = null, string  $line_2 = null, string  $city = null, integer  $state_id = null, string  $state_code = null, string  $zip = null, integer  $country_id = null, string  $country_code = null, string  $latitude = null, string  $longitude = null) : \Unirest\Response

Store Address

Store an address.

Parameters

integer $account_id
string $identifier
string $username
string $addressee
string $organization
string $line_1
string $line_2
string $city
integer $state_id
string $state_code
string $zip
integer $country_id
string $country_code
string $latitude
string $longitude

Returns

\Unirest\Response

urlFromRoute()

urlFromRoute(string  $path = '') : string

URL From Route

Forms an API url from a route path.

Parameters

string $path

Returns

string

_get()

_get(string  $slug = '') : \Unirest\Response

_Get

Performs a get request to a specified url slug.

Parameters

string $slug

Returns

\Unirest\Response

_post()

_post(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Post

Performs a post request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

_patch()

_patch(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Patch

Performs a patch request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

_del()

_del(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Del

Performs a delete request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

getFromCode()

getFromCode(string  $code) : \Unirest\Response

Get From Code

Gets an object by it's Code.

Parameters

string $code

Returns

\Unirest\Response

deleteFromCode()

deleteFromCode(string  $code) : \Unirest\Response

Delete From Code

Delete an object by it's code.

Parameters

string $code

Returns

\Unirest\Response

deleteFromIdentifier()

deleteFromIdentifier(string  $identifier) : \Unirest\Response

Delete From Identifier

Delete an object by it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

deleteFromUsername()

deleteFromUsername(string  $username) : \Unirest\Response

Delete From Username

Delete an object by it's username.

Parameters

string $username

Returns

\Unirest\Response