| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class QueryResult implements \IteratorAggregate |
||
| 18 | { |
||
| 19 | /** @var \PDOStatement The PDO statement. */ |
||
| 20 | private $pdoStatement; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Construct a query result object with the given pdo statement. |
||
| 24 | * |
||
| 25 | * @param \PDOStatement $pdoStatement |
||
| 26 | */ |
||
| 27 | 4 | public function __construct(\PDOStatement $pdoStatement) |
|
| 28 | { |
||
| 29 | 4 | $this->pdoStatement = $pdoStatement; |
|
| 30 | 4 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritdoc} |
||
| 34 | */ |
||
| 35 | 1 | public function getIterator() |
|
| 36 | { |
||
| 37 | 1 | return $this->pdoStatement; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Fetches a row from the result set. |
||
| 42 | * |
||
| 43 | * @return mixed a row from the result set. |
||
| 44 | */ |
||
| 45 | 2 | public function fetch() |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Fetches all rows from the result set. |
||
| 52 | * |
||
| 53 | * @return array all rows from the result set. |
||
| 54 | */ |
||
| 55 | 1 | public function fetchAll() |
|
| 58 | } |
||
| 59 | } |
||
| 60 |