Commit cb7da62a authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #470 from mishak87/patch-1

Connection: Replaced ! is_int with is_string
parents e0e5bf49 80b5d63d
...@@ -514,7 +514,7 @@ class Connection implements DriverConnection ...@@ -514,7 +514,7 @@ class Connection implements DriverConnection
$criteria[] = $columnName . ' = ?'; $criteria[] = $columnName . ' = ?';
} }
if ( ! is_int(key($types))) { if (is_string(key($types))) {
$types = $this->extractTypeValues($identifier, $types); $types = $this->extractTypeValues($identifier, $types);
} }
...@@ -578,7 +578,7 @@ class Connection implements DriverConnection ...@@ -578,7 +578,7 @@ class Connection implements DriverConnection
$set[] = $columnName . ' = ?'; $set[] = $columnName . ' = ?';
} }
if ( ! is_int(key($types))) { if (is_string(key($types))) {
$types = $this->extractTypeValues(array_merge($data, $identifier), $types); $types = $this->extractTypeValues(array_merge($data, $identifier), $types);
} }
...@@ -612,7 +612,7 @@ class Connection implements DriverConnection ...@@ -612,7 +612,7 @@ class Connection implements DriverConnection
'INSERT INTO ' . $tableName . ' (' . implode(', ', array_keys($data)) . ')' . 'INSERT INTO ' . $tableName . ' (' . implode(', ', array_keys($data)) . ')' .
' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')', ' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')',
array_values($data), array_values($data),
is_int(key($types)) ? $types : $this->extractTypeValues($data, $types) is_string(key($types)) ? $this->extractTypeValues($data, $types) : $types
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment