diff options
Diffstat (limited to 'lib/public/idbconnection.php')
-rw-r--r-- | lib/public/idbconnection.php | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/public/idbconnection.php b/lib/public/idbconnection.php index 0d3274d90eb..1117c2da9b2 100644 --- a/lib/public/idbconnection.php +++ b/lib/public/idbconnection.php @@ -77,24 +77,16 @@ interface IDBConnection { public function lastInsertId($table = null); /** - * Insert a row if a matching row doesn't exists. - * @param string $table The table name (will replace *PREFIX*) to perform the replace on. - * @param array $input - * @throws \OC\HintException + * Insert a row if the matching row does not exists. * - * The input array if in the form: - * - * array ( 'id' => array ( 'value' => 6, - * 'key' => true - * ), - * 'name' => array ('value' => 'Stoyan'), - * 'family' => array ('value' => 'Stefanov'), - * 'birth_date' => array ('value' => '1975-06-20') - * ); - * @return bool - * - */ - public function insertIfNotExist($table, $input); + * @param string $table The table name (will replace *PREFIX* with the actual prefix) + * @param array $input data that should be inserted into the table (column name => value) + * @param array|null $compare List of values that should be checked for "if not exists" + * If this is null or an empty array, all keys of $input will be compared + * @return int number of inserted rows + * @throws \Doctrine\DBAL\DBALException + */ + public function insertIfNotExist($table, $input, array $compare = null); /** * Start a transaction |