| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public function insertRows(iterable $rows) { |
||
| 20 | if (!is_iterable($rows)) { |
||
| 21 | throw new BadMethodCallException('Expected $rows to by an iterable'); |
||
| 22 | } |
||
| 23 | $result = []; |
||
| 24 | $query = $this->__toString(); |
||
| 25 | $stmt = $this->db()->prepare($query); |
||
| 26 | foreach ($rows as $row) { |
||
| 27 | $stmt->execute($row); |
||
| 28 | $result[] = (int) $this->db()->getLastInsertId(); |
||
| 29 | } |
||
| 30 | $stmt->closeCursor(); |
||
| 31 | return $result; |
||
| 32 | } |
||
| 51 |