\OpenResourceManagerORM

ORM

Base ORM class, used to set environment variables like API key and host and initiate and maintain an authenticated session.

Summary

Methods
Properties
Constants
__construct()
authenticate()
validateAuth()
$jwt
$uniRequest
$uniBody
$authResponse
$headers
$validCodes
$baseURL
No constants found
No protected methods found
$authURL
$secret
N/A
No private methods found
No private properties found
N/A

Properties

$jwt

$jwt : null|string

JSON Web Token

The current JWT for the authenticated session.

Type

null|string

$uniRequest

$uniRequest : null|\Unirest\Request

Mashape Request

Used to send API requests.

Type

null|\Unirest\Request

$uniBody

$uniBody : null|\Unirest\Request\Body

Mashape Request Body

Used to decode API requests.

Type

null|\Unirest\Request\Body

$authResponse

$authResponse : null|\Unirest\Response

Authentication Response

The response returned from the authentication request.

Type

null|\Unirest\Response

$headers

$headers : array

HTTP Headers

The HTTP headers sent with each request to the API.

Type

array

$validCodes

$validCodes : array

Valid Response Codes

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

Type

array

$baseURL

$baseURL : null|array

Base API URL

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

Type

null|array

$authURL

$authURL : null|string

Base Auth URL

This URL is used to authenticate with the API.

Type

null|string

$secret

$secret : null|string

API Secret/Key

The API key used to authenticate with the API.

Type

null|string

Methods

__construct()

__construct(string  $secret = '', string  $apiHost = 'localhost', integer  $apiVersion = 1, integer  $apiPort = 8000, boolean  $useHTTPS = false) 

ORM Constructor

Constructs an authenticated ORM session.

Parameters

string $secret
string $apiHost
integer $apiVersion
integer $apiPort
boolean $useHTTPS

Throws

\Exception

authenticate()

authenticate() : \Unirest\Response

Authenticate

Authenticates with the API to initiate a JWT authenticated session.

Throws

\Exception

Returns

\Unirest\Response

validateAuth()

validateAuth() : \Unirest\Response

Validate Authenticated Session

Validates the current JWT with with the API to determine if the session is still valid.

Throws

\Exception

Returns

\Unirest\Response