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 Account Route

The base API route for the account 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 Account List

Gets a list of accounts.

Returns

\Unirest\Response

get()

get(integer  $id) : \Unirest\Response

Get Account

Gets an account by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

delete()

delete(integer  $id) : \Unirest\Response

Delete Account

Delete an account by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

deleteFromIdentifier()

deleteFromIdentifier(string  $identifier) : \Unirest\Response

Delete Account From Identifier

Delete an account by it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

deleteFromUsername()

deleteFromUsername(string  $username) : \Unirest\Response

Delete Account From Username

Delete an account by it's username.

Parameters

string $username

Returns

\Unirest\Response

getFromUsername()

getFromUsername(string  $username) : \Unirest\Response

Get Account From Username

Gets an account by it's username.

Parameters

string $username

Returns

\Unirest\Response

getFromIdentifier()

getFromIdentifier(string  $identifier) : \Unirest\Response

Get Account From Identifier

Gets an account by it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

getForLoadStatus()

getForLoadStatus(integer  $id) : \Unirest\Response

Get Account List for Load Status

Gets a list of accounts by the load status id.

Parameters

integer $id

Returns

\Unirest\Response

getForLoadStatusCode()

getForLoadStatusCode(string  $code) : \Unirest\Response

Get Account List for Load Status Code

Gets a list of accounts by te load status code.

Parameters

string $code

Returns

\Unirest\Response

store()

store(string  $identifier, string  $username, string  $name_prefix = null, string  $name_first, string  $name_middle = null, string  $name_last, string  $name_postifx = null, string  $name_phonetic = null, integer  $primary_duty_id = null, string  $primary_duty_code = null, boolean  $should_propagate_password = null, \DateTime  $expires_at = null, boolean  $disabled = null, \DateTime  $birth_date = null, string  $load_status_code = null, integer  $load_status_id = null) : \Unirest\Response

Store Account

Create or update an account, by either it's username, identifier.

Parameters

string $identifier
string $username
string $name_prefix
string $name_first
string $name_middle
string $name_last
string $name_postifx
string $name_phonetic
integer $primary_duty_id
string $primary_duty_code
boolean $should_propagate_password
\DateTime $expires_at
boolean $disabled
\DateTime $birth_date
string $load_status_code
integer $load_status_id

Returns

\Unirest\Response

patch()

patch(string  $identifier = null, string  $username = null, string  $name_prefix = null, string  $name_first = null, string  $name_middle = null, string  $name_last = null, string  $name_postifx = null, string  $name_phonetic = null, integer  $primary_duty_id = null, string  $primary_duty_code = null, boolean  $should_propagate_password = null, \DateTime  $expires_at = null, boolean  $disabled = null, \DateTime  $birth_date = null, string  $load_status_code = null, integer  $load_status_id = null) : \Unirest\Response

Update Account

update an account, by either it's username, identifier.

Parameters

string $identifier
string $username
string $name_prefix
string $name_first
string $name_middle
string $name_last
string $name_postifx
string $name_phonetic
integer $primary_duty_id
string $primary_duty_code
boolean $should_propagate_password
\DateTime $expires_at
boolean $disabled
\DateTime $birth_date
string $load_status_code
integer $load_status_id

Returns

\Unirest\Response

detachFromDuty()

detachFromDuty(integer  $id = null, string  $identifier = null, string  $username = null, integer  $duty_id = null, string  $code = null) : \Unirest\Response

Detach Account From Duty

Detach this account from a duty. Using either the account ID, identifier, or username with either the duty ID or code.

Parameters

integer $id
string $identifier
string $username
integer $duty_id
string $code

Returns

\Unirest\Response

attachToDuty()

attachToDuty(integer  $id = null, string  $identifier = null, string  $username = null, integer  $duty_id = null, string  $code = null) : \Unirest\Response

Attach Account To Duty

Attach this account to a duty. Using either the account ID, identifier, or username with either the duty ID or code.

Parameters

integer $id
string $identifier
string $username
integer $duty_id
string $code

Returns

\Unirest\Response

detachFromSchool()

detachFromSchool(integer  $id = null, string  $identifier = null, string  $username = null, integer  $school_id = null, string  $code = null) : \Unirest\Response

Detach Account From School

Detach this account from a school. Using either the account ID, identifier, or username with either the school ID or code.

Parameters

integer $id
string $identifier
string $username
integer $school_id
string $code

Returns

\Unirest\Response

attachToSchool()

attachToSchool(integer  $id = null, string  $identifier = null, string  $username = null, integer  $school_id = null, string  $code = null) : \Unirest\Response

Attach Account To School

Attach this account to a school. Using either the account ID, identifier, or username with either the school ID or code.

Parameters

integer $id
string $identifier
string $username
integer $school_id
string $code

Returns

\Unirest\Response

detachFromCourse()

detachFromCourse(integer  $id = null, string  $identifier = null, string  $username = null, integer  $course_id = null, string  $code = null) : \Unirest\Response

Detach Account From Course

Detach this account from a course. Using either the account ID, identifier, or username with either the course ID or code.

Parameters

integer $id
string $identifier
string $username
integer $course_id
string $code

Returns

\Unirest\Response

attachToCourse()

attachToCourse(integer  $id = null, string  $identifier = null, string  $username = null, integer  $course_id = null, string  $code = null) : \Unirest\Response

Attach Account To Course

Attach this account to a course. Using either the account ID, identifier, or username with either the course ID or code.

Parameters

integer $id
string $identifier
string $username
integer $course_id
string $code

Returns

\Unirest\Response

detachFromDepartment()

detachFromDepartment(integer  $id = null, string  $identifier = null, string  $username = null, integer  $department_id = null, string  $code = null) : \Unirest\Response

Detach Account From Department

Detach this account from a department. Using either the account ID, identifier, or username with either the department ID or code.

Parameters

integer $id
string $identifier
string $username
integer $department_id
string $code

Returns

\Unirest\Response

attachToDepartment()

attachToDepartment(integer  $id = null, string  $identifier = null, string  $username = null, integer  $department_id = null, string  $code = null) : \Unirest\Response

Attach Account To Department

Attach this account to a department. Using either the account ID, identifier, or username with either the department ID or code.

Parameters

integer $id
string $identifier
string $username
integer $department_id
string $code

Returns

\Unirest\Response

detachFromRoom()

detachFromRoom(integer  $id = null, string  $identifier = null, string  $username = null, integer  $room_id = null, string  $code = null) : \Unirest\Response

Detach Account From Room

Detach this account from a room. Using either the account ID, identifier, or username with either the room ID or code.

Parameters

integer $id
string $identifier
string $username
integer $room_id
string $code

Returns

\Unirest\Response

attachToRoom()

attachToRoom(integer  $id = null, string  $identifier = null, string  $username = null, integer  $room_id = null, string  $code = null) : \Unirest\Response

Attach Account To Room

Attach this account to a room. Using either the account ID, identifier, or username with either the room ID or code.

Parameters

integer $id
string $identifier
string $username
integer $room_id
string $code

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