category Zend
package Zend_Auth
subpackage Adapter
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

__construct() - Sets configuration options

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

Parameters

$zendDb

\Zend_Db_Adapter_Abstract

If null, default database adapter assumed

$tableName

string

$identityColumn

string

$credentialColumn

string

$credentialTreatment

string

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.

authenticate() : \Zend_Auth_Result
inherited_from \Zend_Auth_Adapter_Interface::authenticate()

Exceptions

\Zend_Auth_Adapter_Exception if answering the authentication query is impossible

Returns

\Zend_Auth_Result

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

getAmbiguityIdentity() : boolean

Returns

boolean

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

getDbSelect() : \Zend_Db_Select

Returns

\Zend_Db_Select

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

getResultRowObject(string|array $returnColumns = null, string|array $omitColumns = null) : \stdClass | boolean

Parameters

$returnColumns

stringarray

$omitColumns

stringarray

Returns

\stdClassboolean

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.

setAmbiguityIdentity(integer|boolean $flag) : \Zend_Auth_Adapter_DbTable

Parameters

$flag

integerboolean

Returns

\Zend_Auth_Adapter_DbTable

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(?)'

setCredential(string $credential) : \Zend_Auth_Adapter_DbTable

Parameters

$credential

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

setCredentialColumn(string $credentialColumn) : \Zend_Auth_Adapter_DbTable

Parameters

$credentialColumn

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

setCredentialTreatment(string $treatment) : \Zend_Auth_Adapter_DbTable

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

$treatment

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

setIdentity(string $value) : \Zend_Auth_Adapter_DbTable

Parameters

$value

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

setIdentityColumn(string $identityColumn) : \Zend_Auth_Adapter_DbTable

Parameters

$identityColumn

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

setTableName(string $tableName) : \Zend_Auth_Adapter_DbTable

Parameters

$tableName

string

Returns

\Zend_Auth_Adapter_DbTableProvides a fluent interface

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

_authenticateCreateAuthResult() : \Zend_Auth_Result

Returns

\Zend_Auth_Result

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

_authenticateCreateSelect() : \Zend_Db_Select

Returns

\Zend_Db_Select

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

_authenticateQuerySelect(\Zend_Db_Select $dbSelect) : array

Parameters

$dbSelect

\Zend_Db_Select

Exceptions

\Zend_Auth_Adapter_Exception - when an invalid select object is encountered

Returns

array

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

_authenticateSetup() : true

Exceptions

\Zend_Auth_Adapter_Exception - in the event that setup was not done properly

Returns

true

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

_authenticateValidateResult(array $resultIdentity) : \Zend_Auth_Result

Parameters

$resultIdentity

array

Returns

\Zend_Auth_Result

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

_authenticateValidateResultSet(array $resultIdentities) : true | \Zend_Auth_Result

Parameters

$resultIdentities

array

Returns

true\Zend_Auth_Result

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

_setDbAdapter(\Zend_Db_Adapter_Abstract $zendDb = null) : \Zend_Auth_Adapter_DbTable

Parameters

$zendDb

Exceptions

\Zend_Auth_Adapter_Exception

Returns

\Zend_Auth_Adapter_DbTable

 Properties

 

$_ambiguityIdentity - Flag to indicate same Identity can be used with different credentials. Default is FALSE and need to be set to true to allow ambiguity usage.

$_ambiguityIdentity : boolean

Default

false
 

$_authenticateResultInfo

$_authenticateResultInfo : array

Default

null
 

$_credential - Credential values

$_credential : string

Default

null
 

$_credentialColumns - columns to be used as the credentials

$_credentialColumn : string

Default

null
 

$_credentialTreatment - Treatment applied to the credential, such as MD5() or PASSWORD()

$_credentialTreatment : string

Default

null
 

$_dbSelect

$_dbSelect : \Zend_Db_Select

Default

null
 

$_identity - Identity value

$_identity : string

Default

null
 

$_identityColumn - the column to use as the identity

$_identityColumn : string

Default

null
 

$_resultRow - Results of database authentication query

$_resultRow : array

Default

null
 

$_tableName - the table name to check

$_tableName : string

Default

null
 

Database Connection

$_zendDb : \Zend_Db_Adapter_Abstract

Default

null