Overview

Namespaces

  • Genetsis
    • core
      • activityid
      • user
  • None

Classes

  • AccessToken
  • ClientToken
  • Encryption
  • FileCache
  • LogConfig
  • LoginStatus
  • LoginStatusType
  • OAuth
  • OAuthConfig
  • OauthTemplate
  • RefreshToken
  • Request
  • StoredToken
  • Things
  • User

Interfaces

  • iTokenTypes

Exceptions

  • InvalidGrantException
  • Overview
  • Namespace
  • Class

Class StoredToken

Abstract class which aims to be the parent class of the different types of tokens.

Direct known subclasses

Genetsis\core\AccessToken, Genetsis\core\ClientToken, Genetsis\core\RefreshToken
Abstract
Namespace: Genetsis\core
Package: Genetsis
Category: Bean
Version: 1.0
Since: 2011-09-08
Located at core/StoredToken.php
Methods summary
public
# __construct( string $value, integer $expires_in = 0, integer $expires_at = 0, string $path = '/' )

Parameters

$value
token value.
$expires_in
the seconds until the token expires.
$expires_at
when the token expires. As UNIX timestamp.
$path

path to the folder where cookies will be saved. Only if necessary.

public static boolean|Genetsis\core\AccessToken|Genetsis\core\ClientToken|Genetsis\core\RefreshToken
# factory( string $name, sting $value, $expires_in, $expires_at, $path )

Create an instance of an access token based on the name.

Create an instance of an access token based on the name.

Parameters

$name
The token name.
$value
The token value.
$expires_in
the seconds until the token expires.
$expires_at
when the token expires. As UNIX timestamp.
$path
path to the folder where cookies will be saved.

Returns

boolean|Genetsis\core\AccessToken|Genetsis\core\ClientToken|Genetsis\core\RefreshToken

An object of type Genetsis\core\StoredToken or FALSE if unable to create it.

public string
# getName( )

Returns the token name.

Returns the token name.

We use it for serialization the token content.

Returns

string
The token name.

See

Genetsis\core\iTokenTypes
abstract protected
# setName( )

Sets token name.

Sets token name.

We delegate this method to child classes.

See

Genetsis\core\iTokenTypes
public string
# getValue( )

Returns the token value.

Returns the token value.

Returns

string
The token value. It could be empty.
public
# setValue( string $value )

Sets token value.

Sets token value.

Parameters

$value
value.
public integer
# getExpiresIn( )

Returns the number of seconds when token expires.

Returns the number of seconds when token expires.

Returns

integer
The number of seconds.
public
# setExpiresIn( integer $expires_in )

Sets the number of seconds when token expires.

Sets the number of seconds when token expires.

Parameters

$expires_in
number of seconds it takes to die.
public integer
# getExpiresAt( )

Returns the date when the "token" should be dead.

Returns the date when the "token" should be dead.

Returns

integer
UNIX timestamp with the date. Zero if not defined.
public
# setExpiresAt( integer $expires_at )

Sets the date when the "token" should be dead.

Sets the date when the "token" should be dead.

Parameters

$expires_at
timestamp.
public string
# getPath( )

Returns the path to cookie folder.

Returns the path to cookie folder.

Returns

string

The full path to the folder where the cookies will be saved.

public
# setPath( string $path )

Sets the path where the cookies will be saved.

Sets the path where the cookies will be saved.

Parameters

$path
path to the folder.
Properties summary
protected string $name

The token name.

The token name.

# null
protected string $value

The token value.

The token value.

# null
protected integer $expires_in

integer Number the seconds until the token expires.

integer Number the seconds until the token expires.

# null
protected integer $expires_at

Date when the token expires. As UNIX timestamp.

Date when the token expires. As UNIX timestamp.

# null
protected string $path

Full path to the folder where cookies will be saved.

Full path to the folder where cookies will be saved.

# '/'
API documentation generated by ApiGen