Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Auth_Adapter_DbTable Class Reference

Public Member Functions

 __construct (Zend_Db_Adapter_Abstract $zendDb=null, $tableName=null, $identityColumn=null, $credentialColumn=null, $credentialTreatment=null)
 __construct() - Sets configuration options
 
 setTableName ($tableName)
 setTableName() - set the table name to be used in the select query
 
 setIdentityColumn ($identityColumn)
 setIdentityColumn() - set the column name to be used as the identity column
 
 setCredentialColumn ($credentialColumn)
 setCredentialColumn() - set the column name to be used as the credential column
 
 setCredentialTreatment ($treatment)
 setCredentialTreatment() - allows the developer to pass a parameterized string that is used to transform or treat the input credential data.
 
 setIdentity ($value)
 setIdentity() - set the value to be used as the identity
 
 setCredential ($credential)
 setCredential() - set the credential value to be used, optionally can specify a treatment to be used, should be supplied in parameterized form, such as 'MD5(?)' or 'PASSWORD(?)'
 
 setAmbiguityIdentity ($flag)
 setAmbiguityIdentity() - sets a flag for usage of identical identities with unique credentials.
 
 getAmbiguityIdentity ()
 getAmbiguityIdentity() - returns TRUE for usage of multiple identical identies with different credentials, FALSE if not used.
 
 getDbSelect ()
 getDbSelect() - Return the preauthentication Db Select object for userland select query modification
 
 getResultRowObject ($returnColumns=null, $omitColumns=null)
 getResultRowObject() - Returns the result row as a stdClass object
 
 authenticate ()
 authenticate() - defined by Zend_Auth_Adapter_Interface.
 

Protected Member Functions

 _setDbAdapter (Zend_Db_Adapter_Abstract $zendDb=null)
 _setDbAdapter() - set the database adapter to be used for quering
 
 _authenticateSetup ()
 _authenticateSetup() - This method abstracts the steps involved with making sure that this adapter was indeed setup properly with all required pieces of information.
 
 _authenticateCreateSelect ()
 _authenticateCreateSelect() - This method creates a Zend_Db_Select object that is completely configured to be queried against the database.
 
 _authenticateQuerySelect (Zend_Db_Select $dbSelect)
 _authenticateQuerySelect() - This method accepts a Zend_Db_Select object and performs a query against the database with that object.
 
 _authenticateValidateResultSet (array $resultIdentities)
 _authenticateValidateResultSet() - This method attempts to make certain that only one record was returned in the resultset
 
 _authenticateValidateResult ($resultIdentity)
 _authenticateValidateResult() - This method attempts to validate that the record in the resultset is indeed a record that matched the identity provided to this adapter.
 
 _authenticateCreateAuthResult ()
 _authenticateCreateAuthResult() - Creates a Zend_Auth_Result object from the information that has been collected during the authenticate() attempt.
 

Protected Attributes

 $_zendDb = null
 
 $_dbSelect = null
 
 $_tableName = null
 
 $_identityColumn = null
 
 $_credentialColumn = null
 
 $_identity = null
 
 $_credential = null
 
 $_credentialTreatment = null
 
 $_authenticateResultInfo = null
 
 $_resultRow = null
 
 $_ambiguityIdentity = false
 

Constructor & Destructor Documentation

__construct ( Zend_Db_Adapter_Abstract  $zendDb = null,
  $tableName = null,
  $identityColumn = null,
  $credentialColumn = null,
  $credentialTreatment = null 
)

__construct() - Sets configuration options

Parameters
Zend_Db_Adapter_Abstract$zendDbIf null, default database adapter assumed
string$tableName
string$identityColumn
string$credentialColumn
string$credentialTreatment
Returns
void

Member Function Documentation

_authenticateCreateAuthResult ( )
protected

_authenticateCreateAuthResult() - Creates a Zend_Auth_Result object from the information that has been collected during the authenticate() attempt.

Returns
Zend_Auth_Result
_authenticateCreateSelect ( )
protected

_authenticateCreateSelect() - This method creates a Zend_Db_Select object that is completely configured to be queried against the database.

Returns
Zend_Db_Select
_authenticateQuerySelect ( Zend_Db_Select  $dbSelect)
protected

_authenticateQuerySelect() - This method accepts a Zend_Db_Select object and performs a query against the database with that object.

Parameters
Zend_Db_Select$dbSelect
Exceptions
Zend_Auth_Adapter_Exception- when an invalid select object is encountered
Returns
array
See Also
Zend_Auth_Adapter_Exception
_authenticateSetup ( )
protected

_authenticateSetup() - This method abstracts the steps involved with making sure that this adapter was indeed setup properly with all required pieces of information.

Exceptions
Zend_Auth_Adapter_Exception- in the event that setup was not done properly
Returns
true
See Also
Zend_Auth_Adapter_Exception
_authenticateValidateResult (   $resultIdentity)
protected

_authenticateValidateResult() - This method attempts to validate that the record in the resultset is indeed a record that matched the identity provided to this adapter.

Parameters
array$resultIdentity
Returns
Zend_Auth_Result
_authenticateValidateResultSet ( array  $resultIdentities)
protected

_authenticateValidateResultSet() - This method attempts to make certain that only one record was returned in the resultset

Parameters
array$resultIdentities
Returns
true|Zend_Auth_Result
_setDbAdapter ( Zend_Db_Adapter_Abstract  $zendDb = null)
protected

_setDbAdapter() - set the database adapter to be used for quering

Parameters
Zend_Db_Adapter_Abstract
Exceptions
Zend_Auth_Adapter_Exception
Returns
Zend_Auth_Adapter_DbTable

If no adapter is specified, fetch default database adapter.

authenticate ( )

authenticate() - defined by Zend_Auth_Adapter_Interface.

This method is called to attempt an authentication. Previous to this call, this adapter would have already been configured with all necessary information to successfully connect to a database table and attempt to find a record matching the provided identity.

Exceptions
Zend_Auth_Adapter_Exceptionif answering the authentication query is impossible
Returns
Zend_Auth_Result

Implements Zend_Auth_Adapter_Interface.

getAmbiguityIdentity ( )

getAmbiguityIdentity() - returns TRUE for usage of multiple identical identies with different credentials, FALSE if not used.

Returns
bool
getDbSelect ( )

getDbSelect() - Return the preauthentication Db Select object for userland select query modification

Returns
Zend_Db_Select
getResultRowObject (   $returnColumns = null,
  $omitColumns = null 
)

getResultRowObject() - Returns the result row as a stdClass object

Parameters
string | array$returnColumns
string | array$omitColumns
Returns
stdClass|boolean
setAmbiguityIdentity (   $flag)

setAmbiguityIdentity() - sets a flag for usage of identical identities with unique credentials.

It accepts integers (0, 1) or boolean (true, false) parameters. Default is false.

Parameters
int | bool$flag
Returns
Zend_Auth_Adapter_DbTable
setCredential (   $credential)

setCredential() - set the credential value to be used, optionally can specify a treatment to be used, should be supplied in parameterized form, such as 'MD5(?)' or 'PASSWORD(?)'

Parameters
string$credential
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface
setCredentialColumn (   $credentialColumn)

setCredentialColumn() - set the column name to be used as the credential column

Parameters
string$credentialColumn
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface
setCredentialTreatment (   $treatment)

setCredentialTreatment() - allows the developer to pass a parameterized string that is used to transform or treat the input credential data.

In many cases, passwords and other sensitive data are encrypted, hashed, encoded, obscured, or otherwise treated through some function or algorithm. By specifying a parameterized treatment string with this method, a developer may apply arbitrary SQL upon input credential data.

Examples:

'PASSWORD(?)' 'MD5(?)'

Parameters
string$treatment
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface
setIdentity (   $value)

setIdentity() - set the value to be used as the identity

Parameters
string$value
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface
setIdentityColumn (   $identityColumn)

setIdentityColumn() - set the column name to be used as the identity column

Parameters
string$identityColumn
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface
setTableName (   $tableName)

setTableName() - set the table name to be used in the select query

Parameters
string$tableName
Returns
Zend_Auth_Adapter_DbTable Provides a fluent interface

Member Data Documentation

$_ambiguityIdentity = false
protected
$_authenticateResultInfo = null
protected
$_credential = null
protected
$_credentialColumn = null
protected
$_credentialTreatment = null
protected
$_dbSelect = null
protected
$_identity = null
protected
$_identityColumn = null
protected
$_resultRow = null
protected
$_tableName = null
protected
$_zendDb = null
protected