diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-01-07 10:22:30 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-01-07 14:54:55 +0100 |
commit | fddece9552a4b194cdce8c3916e33fa8597c9008 (patch) | |
tree | ac7ebf668c4dd677e92922e35ff7f0be189935b4 /lib | |
parent | 0a41cfefe38e8bf352895f2b87dd9a04fd627094 (diff) | |
download | nextcloud-server-fddece9552a4b194cdce8c3916e33fa8597c9008.tar.gz nextcloud-server-fddece9552a4b194cdce8c3916e33fa8597c9008.zip |
Remove OC_DB::insertid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/db.php | 15 | ||||
-rw-r--r-- | lib/private/files/cache/storage.php | 2 | ||||
-rw-r--r-- | lib/private/share/share.php | 2 |
3 files changed, 2 insertions, 17 deletions
diff --git a/lib/private/db.php b/lib/private/db.php index f5f0c8798cd..14d9ba0a493 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -158,21 +158,6 @@ class OC_DB { } /** - * gets last value of autoincrement - * @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix - * @return string id - * @throws \OC\DatabaseException - * - * \Doctrine\DBAL\Connection lastInsertId - * - * Call this method right after the insert command or other functions may - * cause trouble! - */ - public static function insertid($table=null) { - return \OC::$server->getDatabaseConnection()->lastInsertId($table); - } - - /** * saves database schema to xml file * @param string $file name of file * @param int $mode diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php index cee69194095..e5235d1ca92 100644 --- a/lib/private/files/cache/storage.php +++ b/lib/private/files/cache/storage.php @@ -61,7 +61,7 @@ class Storage { $connection = \OC_DB::getConnection(); $available = $isAvailable ? 1 : 0; if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $available])) { - $this->numericId = \OC_DB::insertid('*PREFIX*storages'); + $this->numericId = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*storages'); } else { if ($row = self::getStorageById($this->storageId)) { $this->numericId = $row['numeric_id']; diff --git a/lib/private/share/share.php b/lib/private/share/share.php index b10de850356..2b251dba1e0 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2191,7 +2191,7 @@ class Share extends Constants { if ($isGroupShare) { $id = self::insertShare($queriesToExecute['groupShare']); // Save this id, any extra rows for this group share will need to reference it - $parent = \OC_DB::insertid('*PREFIX*share'); + $parent = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share'); unset($queriesToExecute['groupShare']); } |