diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-11 09:00:47 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-11 09:05:30 +0100 |
commit | d1511cdbee24b27eb966eee334f3d686cbaec3d7 (patch) | |
tree | 328cea2f9be6c2f7b050f938364a2039d35e2a9b /lib/private/db | |
parent | 87431605b86674ec23c464c5a27b84c7771a2306 (diff) | |
download | nextcloud-server-d1511cdbee24b27eb966eee334f3d686cbaec3d7.tar.gz nextcloud-server-d1511cdbee24b27eb966eee334f3d686cbaec3d7.zip |
Fix doc blocks of insertIfNotExists() method
Diffstat (limited to 'lib/private/db')
-rw-r--r-- | lib/private/db/adapter.php | 13 | ||||
-rw-r--r-- | lib/private/db/adaptersqlite.php | 13 | ||||
-rw-r--r-- | lib/private/db/connection.php | 14 |
3 files changed, 24 insertions, 16 deletions
diff --git a/lib/private/db/adapter.php b/lib/private/db/adapter.php index bd1604caf20..d0641f113f3 100644 --- a/lib/private/db/adapter.php +++ b/lib/private/db/adapter.php @@ -40,13 +40,16 @@ class Adapter { } /** - * insert the @input values when they do not exist yet - * @param string $table name - * @param array $input key->value pair, key has to be sanitized properly + * Insert a row if the matching row does not exists. + * + * @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 - * @return int count of inserted rows */ - public function insertIfNotExist($table, $input, $compare = null) { + public function insertIfNotExist($table, $input, array $compare = null) { if ($compare === null) { $compare = array_keys($input); } diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index f93183bee90..1528285e11a 100644 --- a/lib/private/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php @@ -19,13 +19,16 @@ class AdapterSqlite extends Adapter { } /** - * @param string $table - * @param array $input - * @param null $compare - * @return int + * Insert a row if the matching row does not exists. + * + * @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, $compare = null) { + public function insertIfNotExist($table, $input, array $compare = null) { if ($compare === null) { $compare = array_keys($input); } diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index cdbfc94a039..023e265f242 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -157,14 +157,16 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { } /** - * Insert a row if a matching row does not exists. - * @param string $table. The table to insert into in the form '*PREFIX*tableName' - * @param array $input. An array of field name/value pairs - * @param array $compare + * Insert a row if the matching row does not exists. + * + * @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 - * @return bool The return value from execute() */ - public function insertIfNotExist($table, $input, $compare = null) { + public function insertIfNotExist($table, $input, array $compare = null) { return $this->adapter->insertIfNotExist($table, $input, $compare); } |