original_string: public function query($pQuery, array $pParams = array())
      {
          $this->_stm = Agl::app()->getDb()->getConnection()->prepare($pQuery);
  
          if (! $this->_stm->execute($pParams)) {
              $error = $this->_stm->errorInfo();
              throw new Exception("The query failed with message '" . $error[2] . "'");
          }
  
          if (Agl::app()->isDebugMode()) {
              Agl::app()->getDb()->incrementCounter();
          }
  
          return $this->_stm->fetchAll(PDO::FETCH_ASSOC);
      }
code: public function query($pQuery, array $pParams = array())
      {
          $this->_stm = Agl::app()->getDb()->getConnection()->prepare($pQuery);
  
          if (! $this->_stm->execute($pParams)) {
              $error = $this->_stm->errorInfo();
              throw new Exception("The query failed with message '" . $error[2] . "'");
          }
  
          if (Agl::app()->isDebugMode()) {
              Agl::app()->getDb()->incrementCounter();
          }
  
          return $this->_stm->fetchAll(PDO::FETCH_ASSOC);
      }
code_tokens: public function query ( $ pQuery , array $ pParams = array ( ) ) { $ this -> _stm = Agl :: app ( ) -> getDb ( ) -> getConnection ( ) -> prepare ( $ pQuery ) ; if ( ! $ this -> _stm -> execute ( $ pParams ) ) { $ error = $ this -> _stm -> errorInfo ( ) ; throw new Exception ( "The query failed with message '" . $ error [ 2 ] . "'" ) ; } if ( Agl :: app ( ) -> isDebugMode ( ) ) { Agl :: app ( ) -> getDb ( ) -> incrementCounter ( ) ; } return $ this -> _stm -> fetchAll ( PDO :: FETCH_ASSOC ) ; }
docstring: Commit the query to the database and return the result.
  
  @return Select
docstring_tokens: Commit the query to the database and return the result .