Total Complexity | 7 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Statement implements StatementInterface |
||
11 | { |
||
12 | /** |
||
13 | * The query result |
||
14 | * |
||
15 | * @var SQLite3Result |
||
16 | */ |
||
17 | protected $result = null; |
||
18 | |||
19 | /** |
||
20 | * Undocumented variable |
||
21 | * |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $offset = 0; |
||
25 | |||
26 | /** |
||
27 | * The constructor |
||
28 | * |
||
29 | * @param SQLite3Result $result |
||
30 | */ |
||
31 | public function __construct(SQLite3Result $result) |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | */ |
||
39 | public function rowCount() |
||
40 | { |
||
41 | // Todo: find a simpler way to count the rows. |
||
42 | $rowCount = 0; |
||
43 | $this->result->reset(); |
||
44 | while ($this->result->fetchArray()) { |
||
45 | $rowCount++; |
||
46 | } |
||
47 | $this->result->reset(); |
||
48 | return $rowCount; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritDoc |
||
53 | */ |
||
54 | public function fetchAssoc() |
||
55 | { |
||
56 | return $this->result->fetchArray(SQLITE3_ASSOC); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @inheritDoc |
||
61 | */ |
||
62 | public function fetchRow() |
||
63 | { |
||
64 | return $this->result->fetchArray(SQLITE3_NUM); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @inheritDoc |
||
69 | */ |
||
70 | public function fetchField() |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * The destructor |
||
80 | */ |
||
81 | public function __destruct() |
||
86 |