summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-02-26 17:39:13 +0100
committerBart Visscher <bartv@thisnet.nl>2013-07-21 23:17:37 +0200
commitde83bf98c759d8af9483306ddea07006693f74be (patch)
tree9ee954ddaddaba547db63a533b906dbfaa86a429
parent013333fe6a41c4681efcff64391d2bf7b1af5ab3 (diff)
downloadnextcloud-server-de83bf98c759d8af9483306ddea07006693f74be.tar.gz
nextcloud-server-de83bf98c759d8af9483306ddea07006693f74be.zip
Group database connection and schema function
-rw-r--r--lib/db.php54
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/db.php b/lib/db.php
index ac40be348be..48e1439a336 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -286,6 +286,33 @@ class OC_DB {
}
/**
+ * @brief Insert a row if a matching row doesn't exists.
+ * @param string $table. The table to insert into in the form '*PREFIX*tableName'
+ * @param array $input. An array of fieldname/value pairs
+ * @returns int number of updated rows
+ */
+ public static function insertIfNotExist($table, $input) {
+ self::connect();
+ return self::$connection->insertIfNotExist($table, $input);
+ }
+
+ /**
+ * Start a transaction
+ */
+ public static function beginTransaction() {
+ self::connect();
+ self::$connection->beginTransaction();
+ }
+
+ /**
+ * Commit the database changes done during a transaction that is in progress
+ */
+ public static function commit() {
+ self::connect();
+ self::$connection->commit();
+ }
+
+ /**
* @brief Disconnect
*
* This is good bye, good bye, yeah!
@@ -341,17 +368,6 @@ class OC_DB {
}
/**
- * @brief Insert a row if a matching row doesn't exists.
- * @param string $table. The table to insert into in the form '*PREFIX*tableName'
- * @param array $input. An array of fieldname/value pairs
- * @returns int number of updated rows
- */
- public static function insertIfNotExist($table, $input) {
- self::connect();
- return self::$connection->insertIfNotExist($table, $input);
- }
-
- /**
* @brief drop a table
* @param string $tableName the table to drop
*/
@@ -379,22 +395,6 @@ class OC_DB {
}
/**
- * Start a transaction
- */
- public static function beginTransaction() {
- self::connect();
- self::$connection->beginTransaction();
- }
-
- /**
- * Commit the database changes done during a transaction that is in progress
- */
- public static function commit() {
- self::connect();
- self::$connection->commit();
- }
-
- /**
* check if a result is an error, works with Doctrine
* @param mixed $result
* @return bool