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. | |
Class to represent an HTTP message.
Definition at line 17 of file AccessToken.php.
| __construct | ( | $platform, | |
$scopes = null, |
|||
$token = null, |
|||
$expires = null |
|||
| ) |
Class constructor.
| Platform | $platform | Platform |
| array | null | $scopes | Scopes for which the access token is valid |
| string | null | $token | Access token string |
| int | null | $expires | Time 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().
| get | ( | $scope = '', |
|
$scopeOnly = false |
|||
| ) |
Obtain a valid access token for a scope.
| string | $scope | Access scope |
| bool | $scopeOnly | If true, a token is requested just for the specified scope |
Definition at line 144 of file AccessToken.php.
References Tool\$defaultTool, Util\jsonDecode(), and AccessToken\save().
| getPlatform | ( | ) |
Get platform.
Definition at line 92 of file AccessToken.php.
| hasScope | ( | $scope = '' | ) |
Check if a valid access token exists for a specific scope (or any scope if none specified).
| string | $scope | Access scope |
Definition at line 125 of file AccessToken.php.
| load | ( | ) |
Load a nonce value from the database.
Definition at line 102 of file AccessToken.php.
Referenced by AccessToken\__construct().
| save | ( | ) |
Save a nonce value in the database.
Definition at line 112 of file AccessToken.php.
Referenced by AccessToken\get().
| int null $created = null |
Timestamp for when the object was created.
Definition at line 53 of file AccessToken.php.
| int null $expires = null |
Timestamp at which the token string expires.
Definition at line 32 of file AccessToken.php.
Referenced by AccessToken\__construct().
| array $scopes = array() |
Scope(s) for which the access token is valid.
Definition at line 39 of file AccessToken.php.
Referenced by AccessToken\__construct().
| string null $token = null |
Access token string.
Definition at line 25 of file AccessToken.php.
Referenced by AccessToken\__construct().
| int null $updated = null |
Timestamp for when the object was last updated.
Definition at line 60 of file AccessToken.php.