## Apache Zeta Components Manual :: Docs For Class ezcAuthenticationOpenidDbStore

### AuthenticationDatabaseTiein::ezcAuthenticationOpenidDbStore

### Class ezcAuthenticationOpenidDbStore

Class providing database storage for OpenID authentication.

This class requires that the database used contains two special tables. See the tutorial for information on how to create those tables.

Example of use:

1. // create an OpenID options object
2. $options=new ezcAuthenticationOpenidOptions ();
3. $options->mode=ezcAuthenticationOpenidFilter ::MODE_SMART;
5. // define a database store
6. $options->store=new ezcAuthenticationOpenidDbStore ( ezcDbInstance :: get () );
8. // create an OpenID filter based on the options object
9. $filter=new ezcAuthenticationOpenidFilter ($options);

Source for this file: /AuthenticationDatabaseTiein/src/filters/openid/openid_db_store.php

    ezcAuthenticationOpenidStore
       |
       --ezcAuthenticationOpenidDbStore

Version: | //autogentag//

### Properties

ezcDbHandler | read/write | `$instance` The database instance to use for database storage.

### Inherited Member Variables

From ezcAuthenticationOpenidStore
protected | `ezcAuthenticationOpenidStore::$options`

### Method Summary

public ezcAuthenticationOpenidDbStore | `__construct( $instance , [ $options = null] )` Creates a new object of this class.
public ezcAuthenticationOpenidAssociation | `getAssociation( $url )` Returns the unserialized association linked to the OpenID provider URL.
public bool | `removeAssociation( $url )` Removes the association linked to the OpenID provider URL.
protected void | `removeNonce( $nonce )` Removes the nonce from the nonces table.
public bool | `storeAssociation( $url , $association )` Stores an association in the store linked to the OpenID provider URL.
public bool | `storeNonce( $nonce )` Stores the nonce in the store.
public bool|int | `useNonce( $nonce )` Checks if the nonce exists and afterwards deletes it.

### Inherited Methods

From ezcAuthenticationOpenidStore
public abstract ezcAuthenticationOpenidAssociation | `ezcAuthenticationOpenidStore::getAssociation()` Returns the association linked to the OpenID provider URL.
public ezcAuthenticationOpenidStoreOptions | `ezcAuthenticationOpenidStore::getOptions()` Returns the options of this class.
public abstract bool | `ezcAuthenticationOpenidStore::removeAssociation()` Removes the association linked to the OpenID provider URL.
public void | `ezcAuthenticationOpenidStore::setOptions()` Sets the options of this class to $options.
public abstract bool | `ezcAuthenticationOpenidStore::storeAssociation()` Stores an association in the store linked to the OpenID provider URL.
public abstract bool | `ezcAuthenticationOpenidStore::storeNonce()` Stores the nonce in the store.
public abstract bool | `ezcAuthenticationOpenidStore::useNonce()` Checks if the nonce exists and afterwards deletes it.

### Methods

#### __construct

ezcAuthenticationOpenidDbStore __construct( $instance , [ezcAuthenticationOpenidDbStoreOptions $options = null] )

Creates a new object of this class.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$instance` | ezcDbHandler | The database instance used for this store
`$options` | ezcAuthenticationOpenidDbStoreOptions | Options for this class

#### getAssociation

ezcAuthenticationOpenidAssociation getAssociation( string $url )

Returns the unserialized association linked to the OpenID provider URL.

Returns false if the association could not be retrieved or if it expired.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$url` | string | The URL of the OpenID provider

##### Redefinition of:

Method | Description
--- | ---
`ezcAuthenticationOpenidStore::getAssociation()` | Returns the association linked to the OpenID provider URL.

#### removeAssociation

bool removeAssociation( string $url )

Removes the association linked to the OpenID provider URL.

Returns true always.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$url` | string | The URL of the OpenID provider

##### Redefinition of:

Method | Description
--- | ---
`ezcAuthenticationOpenidStore::removeAssociation()` | Removes the association linked to the OpenID provider URL.

#### removeNonce

void removeNonce( string $nonce )

Removes the nonce from the nonces table.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$nonce` | string |

#### storeAssociation

bool storeAssociation( string $url , ezcAuthenticationOpenidAssociation $association )

Stores an association in the store linked to the OpenID provider URL.

Returns true always.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$url` | string | The URL of the OpenID provider
`$association` | ezcAuthenticationOpenidAssociation | The association value to store

##### Redefinition of:

Method | Description
--- | ---
`ezcAuthenticationOpenidStore::storeAssociation()` | Stores an association in the store linked to the OpenID provider URL.

#### storeNonce

bool storeNonce( string $nonce )

Stores the nonce in the store.

Returns true if the nonce was stored successfully, and false otherwise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$nonce` | string | The nonce value to store

##### Exceptions:

Type | Description
--- | ---
`ezcBaseFilePermissionException` | if the nonce cannot be written in the store

##### Redefinition of:

Method | Description
--- | ---
`ezcAuthenticationOpenidStore::storeNonce()` | Stores the nonce in the store.

#### useNonce

bool|int useNonce( string $nonce )

Checks if the nonce exists and afterwards deletes it.

Returns the timestamp of the nonce if it exists, and false otherwise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$nonce` | string | The nonce value to check and delete

##### Redefinition of:

Method | Description
--- | ---
`ezcAuthenticationOpenidStore::useNonce()` | Checks if the nonce exists and afterwards deletes it.

Documentation generated by phpDocumentor 1.4.3