category Zend
package Zend_Authentication
subpackage Adapter

 Methods

__construct() - Sets configuration options

__construct(\Zend\Db\Adapter\Adapter $zendDb, string $tableName, string $identityColumn, string $credentialColumn, string $credentialTreatment) : \Zend\Authentication\Adapter\DbTable

Parameters

$tableName

string

Optional

$identityColumn

string

Optional

$credentialColumn

string

Optional

$credentialTreatment

string

Optional

Returns

This method is called to attempt an authentication.

authenticate() : \Zend\Authentication\Result

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\Authentication\Adapter\Exception\RuntimeException if answering the authentication query is impossible

Returns

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

getAmbiguityIdentity() : bool

Returns

bool

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

getDbSelect() : \Zend\Db\Sql\Select

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

getResultRowObject(string | array $returnColumns, string | array $omitColumns) : \stdClass | bool

Parameters

$returnColumns

stringarray

$omitColumns

stringarray

Returns

\stdClassbool

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

setAmbiguityIdentity(int | bool $flag) : \Zend\Authentication\Adapter\DbTable

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

Parameters

$flag

intbool

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setCredential(string $credential) : \Zend\Authentication\Adapter\DbTable

Parameters

$credential

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setCredentialColumn(string $credentialColumn) : \Zend\Authentication\Adapter\DbTable

Parameters

$credentialColumn

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setCredentialTreatment(string $treatment) : \Zend\Authentication\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 parametrized treatment string with this method, a developer may apply arbitrary SQL upon input credential data.

Examples:

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

Parameters

$treatment

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setIdentity(string $value) : \Zend\Authentication\Adapter\DbTable

Parameters

$value

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setIdentityColumn(string $identityColumn) : \Zend\Authentication\Adapter\DbTable

Parameters

$identityColumn

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

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

setTableName(string $tableName) : \Zend\Authentication\Adapter\DbTable

Parameters

$tableName

string

Returns

\Zend\Authentication\Adapter\DbTableProvides a fluent interface

Creates a Zend\Authentication\Result object from the information that has been collected during the authenticate() attempt.

_authenticateCreateAuthResult() : \Zend\Authentication\Result

_authenticateCreateSelect() - This method creates a Zend\Db\Sql\Select object that is completely configured to be queried against the database.

_authenticateCreateSelect() : \Zend\Db\Sql\Select

_authenticateQuerySelect() - This method accepts a Zend\Db\Sql\Select object and performs a query against the database with that object.

_authenticateQuerySelect(\Zend\Db\Sql\Select $dbSelect) : array

Parameters

Exceptions

\Zend\Authentication\Adapter\Exception\RuntimeException 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() : bool

Exceptions

\Zend\Authentication\Adapter\Exception\RuntimeException in the event that setup was not done properly

Returns

bool

_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\Authentication\Result

Parameters

$resultIdentity

array

Returns

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

_authenticateValidateResultSet(array $resultIdentities) : bool | \Zend\Authentication\Result

Parameters

$resultIdentities

array

Returns

 Properties

 

$ambiguityIdentity - Flag to indicate same Identity can be used with different credentials.

$ambiguityIdentity : bool

Default is FALSE and need to be set to true to allow ambiguity usage.

 

$authenticateResultInfo

$authenticateResultInfo : array

 

$credential - Credential values

$credential : string

 

$credentialColumns - columns to be used as the credentials

$credentialColumn : string

 

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

$credentialTreatment : string

 

$dbSelect

$dbSelect : \Zend\Db\Sql\Select

 

$identity - Identity value

$identity : string

 

$identityColumn - the column to use as the identity

$identityColumn : string

 

$resultRow - Results of database authentication query

$resultRow : array

 

$tableName - the table name to check

$tableName : string

 

Database Connection

$zendDb : \Zend\Db\Adapter\Adapter