Auth/Adapter/DbTable.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Auth  
Subpackage
Adapter  
Version
$Id$  

\Zend_Auth_Adapter_DbTable

Package: Zend_Auth\Adapter
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedboolean $_ambiguityIdentity = false
$_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.
Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $_authenticateResultInfo = null
$_authenticateResultInfo
Default valuenullDetails
Type
array
>VPropertyprotectedstring $_credential = null
$_credential - Credential values
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_credentialColumn = null
$_credentialColumns - columns to be used as the credentials
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_credentialTreatment = null
$_credentialTreatment - Treatment applied to the credential, such as MD5() or PASSWORD()
Default valuenullDetails
Type
string
>VPropertyprotected\Zend_Db_Select $_dbSelect = null
Default valuenullDetails
Type
\Zend_Db_Select
>VPropertyprotectedstring $_identity = null
$_identity - Identity value
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_identityColumn = null
$_identityColumn - the column to use as the identity
Default valuenullDetails
Type
string
>VPropertyprotectedarray $_resultRow = null
$_resultRow - Results of database authentication query
Default valuenullDetails
Type
array
>VPropertyprotectedstring $_tableName = null
$_tableName - the table name to check
Default valuenullDetails
Type
string
>VPropertyprotected\Zend_Db_Adapter_Abstract $_zendDb = null
Database Connection
Default valuenullDetails
Type
\Zend_Db_Adapter_Abstract

Methods

methodpublic__construct(\Zend_Db_Adapter_Abstract $zendDb = null, string $tableName = null, string $identityColumn = null, string $credentialColumn = null, string $credentialTreatment = null) : void

__construct() - Sets configuration options

Parameters
NameTypeDescription
$zendDb\Zend_Db_Adapter_Abstract

If null, default database adapter assumed

$tableNamestring
$identityColumnstring
$credentialColumnstring
$credentialTreatmentstring
methodprotected_authenticateCreateAuthResult() : \Zend_Auth_Result

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

Returns
TypeDescription
\Zend_Auth_Result
methodprotected_authenticateCreateSelect() : \Zend_Db_Select

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

Returns
TypeDescription
\Zend_Db_Select
methodprotected_authenticateQuerySelect(\Zend_Db_Select $dbSelect) : array

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

Parameters
NameTypeDescription
$dbSelect\Zend_Db_Select
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Auth_Adapter_Exception- when an invalid select object is encountered
methodprotected_authenticateSetup() : true

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

Returns
TypeDescription
true
Throws
ExceptionDescription
\Zend_Auth_Adapter_Exception- in the event that setup was not done properly
methodprotected_authenticateValidateResult(array $resultIdentity) : \Zend_Auth_Result

_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
NameTypeDescription
$resultIdentityarray
Returns
TypeDescription
\Zend_Auth_Result
methodprotected_authenticateValidateResultSet(array $resultIdentities) : true | \Zend_Auth_Result

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

Parameters
NameTypeDescription
$resultIdentitiesarray
Returns
TypeDescription
true | \Zend_Auth_Result
methodprotected_setDbAdapter( $zendDb = null) : \Zend_Auth_Adapter_DbTable

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

Parameters
NameTypeDescription
$zendDb
Returns
TypeDescription
\Zend_Auth_Adapter_DbTable
Throws
ExceptionDescription
\Zend_Auth_Adapter_Exception
methodpublicauthenticate() : \Zend_Auth_Result

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.

Returns
TypeDescription
\Zend_Auth_Result
Throws
ExceptionDescription
\Zend_Auth_Adapter_Exceptionif answering the authentication query is impossible
methodpublicgetAmbiguityIdentity() : bool

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

Returns
TypeDescription
bool
methodpublicgetDbSelect() : \Zend_Db_Select

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

Returns
TypeDescription
\Zend_Db_Select
methodpublicgetResultRowObject(string | array $returnColumns = null, string | array $omitColumns = null) : \stdClass | boolean

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

Parameters
NameTypeDescription
$returnColumnsstring | array
$omitColumnsstring | array
Returns
TypeDescription
\stdClass | boolean
methodpublicsetAmbiguityIdentity(int | bool $flag) : \Zend_Auth_Adapter_DbTable

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
NameTypeDescription
$flagint | bool
Returns
TypeDescription
\Zend_Auth_Adapter_DbTable
methodpublicsetCredential(string $credential) : \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(?)'

Parameters
NameTypeDescription
$credentialstring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
methodpublicsetCredentialColumn(string $credentialColumn) : \Zend_Auth_Adapter_DbTable

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

Parameters
NameTypeDescription
$credentialColumnstring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
methodpublicsetCredentialTreatment(string $treatment) : \Zend_Auth_Adapter_DbTable

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
NameTypeDescription
$treatmentstring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
methodpublicsetIdentity(string $value) : \Zend_Auth_Adapter_DbTable

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

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
methodpublicsetIdentityColumn(string $identityColumn) : \Zend_Auth_Adapter_DbTable

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

Parameters
NameTypeDescription
$identityColumnstring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
methodpublicsetTableName(string $tableName) : \Zend_Auth_Adapter_DbTable

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

Parameters
NameTypeDescription
$tableNamestring
Returns
TypeDescription
\Zend_Auth_Adapter_DbTableProvides a fluent interface
Documentation was generated by phpDocumentor 2.2.0 .