diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-26 08:30:42 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-21 23:17:37 +0200 |
commit | 19b9c896340c572d9a42d033cd8824f33d18efa3 (patch) | |
tree | 5125454219343ed1686a634e91cd7d454007c006 /lib/db/connection.php | |
parent | 58991150ab17846640907d43a6d4b0ff502d4986 (diff) | |
download | nextcloud-server-19b9c896340c572d9a42d033cd8824f33d18efa3.tar.gz nextcloud-server-19b9c896340c572d9a42d033cd8824f33d18efa3.zip |
Move insertIfNotExist to Connection wrapper
Real implementation is in DB\Adapter* classes
Diffstat (limited to 'lib/db/connection.php')
-rw-r--r-- | lib/db/connection.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/db/connection.php b/lib/db/connection.php index 8442efc47c9..e18062d78f3 100644 --- a/lib/db/connection.php +++ b/lib/db/connection.php @@ -138,8 +138,18 @@ class Connection extends \Doctrine\DBAL\Connection { return parent::lastInsertId($seqName); } + /** + * @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 bool The return value from execute() + */ + public function insertIfNotExist($table, $input) { + return $this->adapter->insertIfNotExist($table, $input); + } + // internal use - public function replaceTablePrefix($statement) { + protected function replaceTablePrefix($statement) { return str_replace( '*PREFIX*', $this->table_prefix, $statement ); } |