1 | <?php |
||
9 | class DbalReader implements CountableReaderInterface |
||
10 | { |
||
11 | /** @var Connection */ |
||
12 | private $connection; |
||
13 | |||
14 | private $data; |
||
15 | |||
16 | /** @var Statement */ |
||
17 | private $stmt; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $sql; |
||
21 | /** @var array */ |
||
22 | private $params; |
||
23 | |||
24 | /** @var integer */ |
||
25 | private $rowCount; |
||
26 | /** @var bool */ |
||
27 | private $rowCountCalculated = true; |
||
28 | |||
29 | private $key; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param Connection $connection Database connection |
||
35 | * @param string $sql SQL statement |
||
36 | * @param array $params SQL statement parameters |
||
37 | */ |
||
38 | public function __construct(Connection $connection, $sql, array $params = array()) |
||
44 | |||
45 | /** |
||
46 | * Do calculate row count? |
||
47 | * |
||
48 | * @param bool $calculate |
||
49 | * |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setRowCountCalculated($calculate = true) |
||
58 | |||
59 | /** |
||
60 | * Is row count calculated? |
||
61 | * |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function isRowCountCalculated() |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function getFields() |
||
83 | |||
84 | /** |
||
85 | * Set Query string with Parameters |
||
86 | * |
||
87 | * @param string $sql |
||
88 | * @param array $params |
||
89 | * |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setSql($sql, array $params = array()) |
||
100 | |||
101 | /** |
||
102 | * Set SQL parameters |
||
103 | * |
||
104 | * @param array $params |
||
105 | * |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function setSqlParameters(array $params) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function current() |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function next() |
||
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | public function key() |
||
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function valid() |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function rewind() |
||
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | public function count() |
||
192 | |||
193 | private function doCalcRowCount() |
||
200 | |||
201 | /** |
||
202 | * Prepare given statement |
||
203 | * |
||
204 | * @param string $sql |
||
205 | * @param array $params |
||
206 | * |
||
207 | * @return Statement |
||
208 | */ |
||
209 | private function prepare($sql, array $params) |
||
218 | } |
||
219 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.