The method origins from the early days and does not differ from execute() anyway. For now it just forwards the call, but will be removed in future releases.
$affectedCount = 0;
WCF::getDB()->beginTransaction();
foreach ($objectIDs as $objectID) {
- $statement->executeUnbuffered(array($objectID));
+ $statement->execute(array($objectID));
$affectedCount += $statement->getAffectedRows();
}
WCF::getDB()->commitTransaction();
self::getDB()->beginTransaction();
foreach ($acpTemplateInserts as $acpTemplate) {
- $statement->executeUnbuffered(array($acpTemplate, 'wcf'));
+ $statement->execute(array($acpTemplate, 'wcf'));
}
self::getDB()->commitTransaction();
}
self::getDB()->beginTransaction();
foreach ($fileInserts as $file) {
- $statement->executeUnbuffered(array($file, 'wcf'));
+ $statement->execute(array($file, 'wcf'));
}
self::getDB()->commitTransaction();
}
/**
* Executes a prepared statement.
*
+ * @deprecated 2.1 - Please use execute() instead
* @param array $parameters
*/
public function executeUnbuffered(array $parameters = array()) {
- $this->parameters = $parameters;
- $this->database->incrementQueryCount();
-
- try {
- if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->start($this->query, Benchmark::TYPE_SQL_QUERY);
-
- if (empty($parameters)) $this->pdoStatement->execute();
- else $this->pdoStatement->execute($parameters);
-
- if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
- }
- catch (\PDOException $e) {
- if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
-
- throw new DatabaseException('Could not execute prepared statement: '.$e->getMessage(), $this->database, $this);
- }
+ $this->execute($parameters);
}
/**