Пример #1
0
 /**
  * _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\Authentication\Adapter\Exception - when an invalid select
  *                                       object is encountered
  * @return array
  */
 protected function _authenticateQuerySelect(DBSelect $dbSelect)
 {
     try {
         if ($this->_zendDb->getFetchMode() != Db::FETCH_ASSOC) {
             $origDbFetchMode = $this->_zendDb->getFetchMode();
             $this->_zendDb->setFetchMode(Db::FETCH_ASSOC);
         }
         $resultIdentities = $this->_zendDb->fetchAll($dbSelect->__toString());
         if (isset($origDbFetchMode)) {
             $this->_zendDb->setFetchMode($origDbFetchMode);
             unset($origDbFetchMode);
         }
     } catch (\Exception $e) {
         throw new Exception\RuntimeException('The supplied parameters to Zend\\Authentication\\Adapter\\DbTable failed to ' . 'produce a valid sql statement, please check table and column names ' . 'for validity.', 0, $e);
     }
     return $resultIdentities;
 }