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