Skip to content
Snippets Groups Projects
Commit fefcbb96 authored by Joas Schilling's avatar Joas Schilling
Browse files

Also use all keys for an empty array, just in case

parent 2af8fea2
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ class Adapter {
* @throws \Doctrine\DBAL\DBALException
*/
public function insertIfNotExist($table, $input, array $compare = null) {
if ($compare === null) {
if (empty($compare)) {
$compare = array_keys($input);
}
$query = 'INSERT INTO `' .$table . '` (`'
......
......@@ -29,7 +29,7 @@ class AdapterSqlite extends Adapter {
* @throws \Doctrine\DBAL\DBALException
*/
public function insertIfNotExist($table, $input, array $compare = null) {
if ($compare === null) {
if (empty($compare)) {
$compare = array_keys($input);
}
$fieldList = '`' . implode('`,`', array_keys($input)) . '`';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment