LTI Integration Library 5.0.0-rc2
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
AccessToken Class Reference

Class to represent an HTTP message. More...

Public Member Functions

 __construct ($platform, $scopes=null, $token=null, $expires=null)
 Class constructor.
 
Platform getPlatform ()
 Get platform.
 
bool load ()
 Load a nonce value from the database.
 
bool save ()
 Save a nonce value in the database.
 
bool hasScope ($scope='')
 Check if a valid access token exists for a specific scope (or any scope if none specified).
 
AccessToken get ($scope='', $scopeOnly=false)
 Obtain a valid access token for a scope.
 

Public Attributes

string null $token = null
 Access token string.
 
datetime null $expires = null
 Timestamp at which the token string expires.
 
array $scopes = array()
 Scope(s) for which the access token is valid.
 
int null $created = null
 Timestamp for when the object was created.
 
int null $updated = null
 Timestamp for when the object was last updated.
 

Detailed Description

Class to represent an HTTP message.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Version
3.0.0
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

__construct (   $platform,
  $scopes = null,
  $token = null,
  $expires = null 
)

Class constructor.

Parameters
Platform$platformPlatform
array | null$scopesScopes for which the access token is valid
string$tokenAccess token string
datetime$expiresTime in seconds after which the token string will expire

Member Function Documentation

◆ get()

AccessToken get (   $scope = '',
  $scopeOnly = false 
)

Obtain a valid access token for a scope.

Parameters
string$scopeAccess scope
bool$scopeOnlyIf true, a token is requested just for the specified scope
Returns
AccessToken New access token

◆ getPlatform()

Platform getPlatform ( )

Get platform.

Returns
Platform Platform object for this resource link.

◆ hasScope()

bool hasScope (   $scope = '')

Check if a valid access token exists for a specific scope (or any scope if none specified).

Parameters
string$scopeAccess scope
Returns
bool True if there is an unexpired access token for specified scope

◆ load()

bool load ( )

Load a nonce value from the database.

Returns
bool True if the nonce value was successfully loaded

◆ save()

bool save ( )

Save a nonce value in the database.

Returns
bool True if the nonce value was successfully saved

Member Data Documentation

◆ $created

int null $created = null

Timestamp for when the object was created.

$created

◆ $expires

datetime null $expires = null

Timestamp at which the token string expires.

$expires

◆ $scopes

array $scopes = array()

Scope(s) for which the access token is valid.

$scopes

◆ $token

string null $token = null

Access token string.

$token

◆ $updated

int null $updated = null

Timestamp for when the object was last updated.

$updated


The documentation for this class was generated from the following file: