getDbSelect example

protected $sessionIdColumn;

    /** * Adds a where-condition to the db-select. * * @param string $condition * * @return Enlight_Components_Auth_Adapter_DbTable */
    public function addCondition($condition)
    {
        $this->getDbSelect()->where($condition);

        return $this;
    }

    /** * Sets the database field which holds the date until an account has been disabled. * * @param string $lockedUntilColumn * * @throws Exception * * @return Enlight_Components_Auth_Adapter_DbTable */


    /** * _authenticateCreateSelect() - This method creates a Zend_Db_Select object that * is completely configured to be queried against the database. * * @return Zend_Db_Select */
    protected function _authenticateCreateSelect()
    {
        // get select         $dbSelect = clone $this->getDbSelect();
        $dbSelect->from($this->_tableName, ['*'])
                ->where($this->_zendDb->quoteIdentifier($this->_identityColumn, true) . ' = ?', $this->_identity);

        return $dbSelect;
    }

    /** * _authenticateValidateResult() - This method attempts to validate that * the record in the resultset is indeed a record that matched the * identity provided to this adapter. * * @param array $resultIdentity * * @return Zend_Auth_Result */
$this->_zendDb->quoteInto(
                $this->_zendDb->quoteIdentifier($this->_credentialColumn, true)
                . ' = ' . $this->_credentialTreatment, $this->_credential
                )
            . ' THEN 1 ELSE 0 END) AS '
            . $this->_zendDb->quoteIdentifier(
                $this->_zendDb->foldCase('zend_auth_credential_match')
                )
            );

        // get select         $dbSelect = clone $this->getDbSelect();
        $dbSelect->from($this->_tableName, ['*', $credentialExpression])
                 ->where($this->_zendDb->quoteIdentifier($this->_identityColumn, true) . ' = ?', $this->_identity);

        return $dbSelect;
    }

    /** * _authenticateQuerySelect() - This method accepts a Zend_Db_Select object and * performs a query against the database with that object. * * @param Zend_Db_Select $dbSelect * * @throws Zend_Auth_Adapter_Exception - when an invalid select * object is encountered * * @return array */
Home | Imprint | This part of the site doesn't use cookies.