We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b48055 commit 17170b4Copy full SHA for 17170b4
src/Builder/RunnableInsert.php
@@ -1,12 +1,18 @@
1
<?php
2
namespace Kir\MySQL\Builder;
3
4
+use BadMethodCallException;
5
+use Traversable;
6
+
7
class RunnableInsert extends Insert {
8
/**
- * @param array $rows
9
+ * @param array|Traversable $rows
10
* @return int[] Insert IDs
11
*/
- public function insertRows(array $rows) {
12
+ public function insertRows($rows) {
13
+ if(!(is_array($rows) || $rows instanceof Traversable)) {
14
+ throw new BadMethodCallException('Expected $rows to by an array or an instance of \\Traversable');
15
+ }
16
$result = [];
17
$query = $this->__toString();
18
$stmt = $this->db()->prepare($query);
0 commit comments