LTI Integration Library 4.10.3
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.
 
 getPlatform ()
 Get platform.
 
 load ()
 Load a nonce value from the database.
 
 save ()
 Save a nonce value in the database.
 
 hasScope ($scope='')
 Check if a valid access token exists for a specific scope (or any scope if none specified).
 
 get ($scope='', $scopeOnly=false)
 Obtain a valid access token for a scope.
 

Data Fields

 $token = null
 Access token string.
 
 $expires = null
 Timestamp at which the token string expires.
 
 $scopes = array()
 Scope(s) for which the access token is valid.
 
 $created = null
 Timestamp for when the object was created.
 
 $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

Definition at line 17 of file AccessToken.php.

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 | null$tokenAccess token string
int | null$expiresTime in seconds after which the token string will expire

Definition at line 70 of file AccessToken.php.

References AccessToken\$expires, AccessToken\$scopes, AccessToken\$token, and AccessToken\load().

Member Function Documentation

◆ get()

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

Definition at line 144 of file AccessToken.php.

References Tool\$defaultTool, Util\jsonDecode(), and AccessToken\save().

◆ getPlatform()

getPlatform ( )

Get platform.

Returns
Platform Platform object for this resource link.

Definition at line 92 of file AccessToken.php.

◆ hasScope()

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

Definition at line 125 of file AccessToken.php.

◆ load()

load ( )

Load a nonce value from the database.

Returns
bool True if the nonce value was successfully loaded

Definition at line 102 of file AccessToken.php.

Referenced by AccessToken\__construct().

◆ save()

save ( )

Save a nonce value in the database.

Returns
bool True if the nonce value was successfully saved

Definition at line 112 of file AccessToken.php.

Referenced by AccessToken\get().

Field Documentation

◆ $created

int null $created = null

Timestamp for when the object was created.

Definition at line 53 of file AccessToken.php.

◆ $expires

int null $expires = null

Timestamp at which the token string expires.

Definition at line 32 of file AccessToken.php.

Referenced by AccessToken\__construct().

◆ $scopes

array $scopes = array()

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

Definition at line 39 of file AccessToken.php.

Referenced by AccessToken\__construct().

◆ $token

string null $token = null

Access token string.

Definition at line 25 of file AccessToken.php.

Referenced by AccessToken\__construct().

◆ $updated

int null $updated = null

Timestamp for when the object was last updated.

Definition at line 60 of file AccessToken.php.


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