/**
* @param string statement
* @param array
* @return ResultSet
*/
public function queryArgs($statement, array $params)
{
$this->connection->connect();
if ($params) {
if (!$this->preprocessor) {
$this->preprocessor = new SqlPreprocessor($this->connection);
}
array_unshift($params, $statement);
list($statement, $params) = $this->preprocessor->process($params);
}
try {
$result = new ResultSet($this->connection, $statement, $params);
} catch (\PDOException $e) {
$e->queryString = $statement;
$this->connection->onQuery($this->connection, $e);
throw $e;
}
$this->connection->onQuery($this->connection, $result);
return $result;
}