diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-08-29 20:53:51 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-08-29 20:53:51 +0200 |
commit | 7458e21f2cfb00d6c0628ed41a0bcd7a87e19ee8 (patch) | |
tree | de8546a5f87543bb9b8e1aaebddeeb16db8c2507 /apps/user_ldap/lib/helper.php | |
parent | 9b1c4a1e74bc1f63b26d71f735c5c1c371df0444 (diff) | |
download | nextcloud-server-7458e21f2cfb00d6c0628ed41a0bcd7a87e19ee8.tar.gz nextcloud-server-7458e21f2cfb00d6c0628ed41a0bcd7a87e19ee8.zip |
Use Doctrine Platform to generate SQL query for table truncation.
Diffstat (limited to 'apps/user_ldap/lib/helper.php')
-rw-r--r-- | apps/user_ldap/lib/helper.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index b6d7bad8727..bce28230fea 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -159,14 +159,9 @@ class Helper { return false; } - $dbtype = \OCP\Config::getSystemValue('dbtype'); - if(strpos($dbtype, 'sqlite') !== false || $dbtype === 'oci') { - $query = \OCP\DB::prepare('DELETE FROM '.$table); - } else { - $query = \OCP\DB::prepare('TRUNCATE '.$table); - } - - + $connection = \OC_DB::getConnection(); + $sql = $connection->getDatabasePlatform()->getTruncateTableSQL($table); + $query = \OCP\DB::prepare($sql); $res = $query->execute(); if(\OCP\DB::isError($res)) { |