Example #1
0
 /**
  * Returns the number of rows affected by the last SQL statement
  *
  * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
  * executed by the corresponding Statement object.
  *
  * If the last SQL statement executed by the associated Statement object was a SELECT statement,
  * some databases may return the number of rows returned by that statement. However,
  * this behaviour is not guaranteed for all databases and should not be
  * relied on for portable applications.
  *
  * @return integer The number of rows.
  */
 public function rowCount()
 {
     return $this->statement->rowCount();
 }
Example #2
0
 /**
  * Log a query to all active logging keys.
  *
  * @param $statement
  *   The prepared statement object to log.
  * @param $args
  *   The arguments passed to the statement object.
  * @param $time
  *   The time in milliseconds the query took to execute.
  */
 public function log(StatementInterface $statement, $args, $time)
 {
     foreach (array_keys($this->queryLog) as $key) {
         $this->queryLog[$key][] = array('query' => $statement->getQueryString(), 'args' => $args, 'target' => $statement->dbh->getTarget(), 'caller' => $this->findCaller(), 'time' => $time);
     }
 }