summaryrefslogtreecommitdiffstats
path: root/lib/db
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-09-01 12:35:20 +0200
committerBart Visscher <bartv@thisnet.nl>2013-09-19 18:13:39 +0200
commit55efe1e56ced021ae99d7af6d6331882fd8244ba (patch)
tree3a5cff9ee9ac7c180c8757c70d71c739d509ea3c /lib/db
parentf6284bdce735651a572474d97930239bd2315d52 (diff)
downloadnextcloud-server-55efe1e56ced021ae99d7af6d6331882fd8244ba.tar.gz
nextcloud-server-55efe1e56ced021ae99d7af6d6331882fd8244ba.zip
Fix insert/update/delete helper functions for oracle
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/oracleconnection.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/db/oracleconnection.php b/lib/db/oracleconnection.php
new file mode 100644
index 00000000000..3da3d91dbfa
--- /dev/null
+++ b/lib/db/oracleconnection.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\DB;
+
+class OracleConnection extends Connection {
+ /**
+ * Quote the keys of the array
+ */
+ private function quoteKeys(array $data) {
+ $return = array();
+ foreach($data as $key => $value) {
+ $return[$this->quoteIdentifier($key)] = $value;
+ }
+ return $return;
+ }
+
+ /*
+ * (inherit docs)
+ */
+ public function insert($tableName, array $data, array $types = array()) {
+ $tableName = $this->quoteIdentifier($tableName);
+ $data = $this->quoteKeys($data);
+ return parent::insert($tableName, $data, $types);
+ }
+
+ /*
+ * (inherit docs)
+ */
+ public function update($tableName, array $data, array $identifier, array $types = array()) {
+ $tableName = $this->quoteIdentifier($tableName);
+ $data = $this->quoteKeys($data);
+ $identifier = $this->quoteKeys($identifier);
+ return parent::update($tableName, $data, $identifier, $types);
+ }
+
+ /*
+ * (inherit docs)
+ */
+ public function delete($tableName, array $identifier) {
+ $tableName = $this->quoteIdentifier($tableName);
+ $identifier = $this->quoteKeys($identifier);
+ return parent::delete($tableName, $identifier);
+ }
+}