Modules

OAuth_Token_Access
extends Kohana_OAuth_Token_Access
extends OAuth_Token
extends Kohana_OAuth_Token

OAuth Access Token

package
Kohana/OAuth
category
Token
author
Kohana Team
copyright
© 2010 Kohana Team
license
http://kohanaframework.org/license
since
3.0.7

Class declared in MODPATH/oauth/classes/oauth/token/access.php on line 3.

Properties

protected $name

protected $required

protected string $secret

token secret

protected string $token

token key

Methods

public __construct( [ array $options = NULL ] ) (defined in Kohana_OAuth_Token)

Sets the token and secret values.

Parameters

  • array $options = NULL - Token options

Return Values

  • void

Source Code

public function __construct(array $options = NULL)
{
	foreach ($this->required as $key)
	{
		if ( ! isset($options[$key]))
		{
			throw new Kohana_OAuth_Exception('Required option not passed: :option',
				array(':option' => $key));
		}

		$this->$key = $options[$key];
	}
}

public __get( string $key ) (defined in Kohana_OAuth_Token)

Return the value of any protected class variable.

// Get the token secret
$secret = $token->secret;

Parameters

  • string $key required - Variable name

Return Values

  • mixed

Source Code

public function __get($key)
{
	return $this->$key;
}

public __toString( ) (defined in Kohana_OAuth_Token)

Returns the token key.

Return Values

  • string

Source Code

public function __toString()
{
	return (string) $this->token;
}

public static factory( string $name [, array $options = NULL ] ) (defined in Kohana_OAuth_Token)

Create a new token object.

$token = OAuth_Token::factory($name);

Parameters

  • string $name required - Token type
  • array $options = NULL - Token options

Return Values

  • OAuth_Token

Source Code

public static function factory($name, array $options = NULL)
{
	$class = 'OAuth_Token_'.$name;

	return new $class($options);
}