$statement->execute($statementParameters);
}
+ /**
+ * @see wcf\data\IEditableObject::updateCounters()
+ */
+ public function updateCounters(array $counters = array()) {
+ if (!count($counters)) return;
+
+ $updateSQL = '';
+ $statementParameters = array();
+ foreach ($counters as $key => $value) {
+ if (!empty($updateSQL)) $updateSQL .= ', ';
+ $updateSQL .= $key . ' = ' . $key . ' + ?';
+ $statementParameters[] = $value;
+ }
+ $statementParameters[] = $this->__get(static::getDatabaseTableIndexName());
+
+ $sql = "UPDATE ".static::getDatabaseTableName()."
+ SET ".$updateSQL."
+ WHERE ".static::getDatabaseTableIndexName()." = ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute($statementParameters);
+ }
+
/**
* @see wcf\data\IEditableObject::delete()
*/
*/
public function update(array $parameters = array());
+ /**
+ * Updates the counters of this object.
+ *
+ * @param array $counters
+ */
+ public function updateCounters(array $counters = array());
+
/**
* Deletes this object.
*/