/**
  * 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()
 {
     // build credential expression
     if (empty($this->_credentialTreatment) || strpos($this->_credentialTreatment, "?") === false) {
         $this->_credentialTreatment = '?';
     }
     $credentialExpression = '(CASE WHEN ' . $this->_db->escape($this->_credentialColumn, true) . ' = ' . $this->_credentialTreatment . ' THEN 1 ELSE 0 END) AS ' . $this->_db->escape('zend_auth_credential_match', true);
     // get select
     $dbSelect = "SELECT *, {$credentialExpression} " . " FROM " . $this->_tableName . ' WHERE ' . $this->_db->escape($this->_identityColumn, true) . ' = ?';
     if ($this->_conditionStatement) {
         $dbSelect .= ' AND ' . $this->_conditionStatement;
     }
     return $dbSelect;
 }