original_string: public function query($queryString, array $queryValues = [])
      {
          if (!is_string($queryString) || empty($queryString)) {
              throw new \InvalidArgumentException(
                  __METHOD__.': The specified query is not valid.'
              );
          }
  
          $this->connect();
          $this->resourceHandle = $this->dbConnection->prepare($queryString);
  
          try {
              // start transaction
              $this->dbConnection->beginTransaction();
  
              // execute the query and return a status
              $this->executionStatus = $this->resourceHandle->execute($queryValues ?: null);
  
              // get last inserted id if present
              $this->lastInsertedId = $this->dbConnection->lastInsertId();
  
              // finally execute the query
              $this->dbConnection->commit();
          } catch (\PDOException $ex) {
              // If an error occurs, execute rollback
              $this->dbConnection->rollBack();
  
              // Return execution status to false
              $this->executionStatus = false;
              $this->resourceHandle->closeCursor();
  
              throw new \RuntimeException(
                  __METHOD__.": {$ex->getMessage()}\nqueryString: {$queryString}"
              );
          }
  
          return $this->resourceHandle;
      }
code: public function query($queryString, array $queryValues = [])
      {
          if (!is_string($queryString) || empty($queryString)) {
              throw new \InvalidArgumentException(
                  __METHOD__.': The specified query is not valid.'
              );
          }
  
          $this->connect();
          $this->resourceHandle = $this->dbConnection->prepare($queryString);
  
          try {
              // start transaction
              $this->dbConnection->beginTransaction();
  
              // execute the query and return a status
              $this->executionStatus = $this->resourceHandle->execute($queryValues ?: null);
  
              // get last inserted id if present
              $this->lastInsertedId = $this->dbConnection->lastInsertId();
  
              // finally execute the query
              $this->dbConnection->commit();
          } catch (\PDOException $ex) {
              // If an error occurs, execute rollback
              $this->dbConnection->rollBack();
  
              // Return execution status to false
              $this->executionStatus = false;
              $this->resourceHandle->closeCursor();
  
              throw new \RuntimeException(
                  __METHOD__.": {$ex->getMessage()}\nqueryString: {$queryString}"
              );
          }
  
          return $this->resourceHandle;
      }
code_tokens: public function query ( $ queryString , array $ queryValues = [ ] ) { if ( ! is_string ( $ queryString ) || empty ( $ queryString ) ) { throw new \ InvalidArgumentException ( __METHOD__ . ': The specified query is not valid.' ) ; } $ this -> connect ( ) ; $ this -> resourceHandle = $ this -> dbConnection -> prepare ( $ queryString ) ; try { // start transaction $ this -> dbConnection -> beginTransaction ( ) ; // execute the query and return a status $ this -> executionStatus = $ this -> resourceHandle -> execute ( $ queryValues ? : null ) ; // get last inserted id if present $ this -> lastInsertedId = $ this -> dbConnection -> lastInsertId ( ) ; // finally execute the query $ this -> dbConnection -> commit ( ) ; } catch ( \ PDOException $ ex ) { // If an error occurs, execute rollback $ this -> dbConnection -> rollBack ( ) ; // Return execution status to false $ this -> executionStatus = false ; $ this -> resourceHandle -> closeCursor ( ) ; throw new \ RuntimeException ( __METHOD__ . ": {$ex->getMessage()}\nqueryString: {$queryString}" ) ; } return $ this -> resourceHandle ; }
docstring: Execute a query or a prepared statement with a params array values.
  
  @param string $queryString
  @param array $queryValues in format [:placeholder => 'value']
  
  @return mixed
docstring_tokens: Execute a query or a prepared statement with a params array values .