diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-24 13:21:09 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-18 11:10:41 +0100 |
commit | 88cd61521459a18599407f83347f1d6a0e7700cc (patch) | |
tree | f95db18fb04c82d562b18ac92d0ee8cef416745a /lib/private/appframework | |
parent | e4d5229940526352378f0141de4c9a6fd53611a9 (diff) | |
download | nextcloud-server-88cd61521459a18599407f83347f1d6a0e7700cc.tar.gz nextcloud-server-88cd61521459a18599407f83347f1d6a0e7700cc.zip |
Introduce IDBConnection::setValues()
setValues() attempts to insert a new row, or failing that, update an
existing row. The ability to set preconditions is also available.
Diffstat (limited to 'lib/private/appframework')
-rw-r--r-- | lib/private/appframework/db/db.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/appframework/db/db.php b/lib/private/appframework/db/db.php index 812649daa78..5fdc5d1066c 100644 --- a/lib/private/appframework/db/db.php +++ b/lib/private/appframework/db/db.php @@ -147,6 +147,21 @@ class Db implements IDb { } /** + * Insert or update a row value + * + * @param string $table + * @param array $keys (column name => value) + * @param array $values (column name => value) + * @param array $updatePreconditionValues ensure values match preconditions (column name => value) + * @return int number of new rows + * @throws \Doctrine\DBAL\DBALException + * @throws PreconditionNotMetException + */ + public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []) { + return $this->connection->setValues($table, $keys, $values, $updatePreconditionValues); + } + + /** * Start a transaction */ public function beginTransaction() { |