1 | <?php |
||
25 | class Result extends \PDOStatement { |
||
26 | |||
27 | /** |
||
28 | * Reference to fbird resource |
||
29 | * |
||
30 | * @var resource |
||
31 | */ |
||
32 | private $statement; |
||
33 | |||
34 | /** |
||
35 | * Current row in result array |
||
36 | * |
||
37 | * @var int |
||
38 | */ |
||
39 | private $row; |
||
40 | |||
41 | /** |
||
42 | * Data pulled from query |
||
43 | * |
||
44 | * @param mixed |
||
45 | */ |
||
46 | private $result = array(); |
||
47 | |||
48 | /** |
||
49 | * Reference to the db drive to de-duplicate error functions |
||
50 | * |
||
51 | * @var Driver |
||
52 | */ |
||
53 | private $db; |
||
54 | |||
55 | /** |
||
56 | * Create the object by passing the resource for |
||
57 | * the query |
||
58 | * |
||
59 | * @param resource $link |
||
60 | * @param Driver|null $db |
||
61 | */ |
||
62 | public function __construct($link, Driver $db = NULL) |
||
87 | |||
88 | // -------------------------------------------------------------------------- |
||
89 | |||
90 | /** |
||
91 | * Invalidate method for data consistency |
||
92 | * |
||
93 | * @param mixed $column |
||
94 | * @param mixed $param |
||
95 | * @param int $type |
||
96 | * @param mixed $maxlen |
||
97 | * @param array $driverdata |
||
98 | * @return NULL |
||
99 | */ |
||
100 | public function bindColumn($column, &$param, $type=NULL, $maxlen=NULL, $driverdata=NULL) |
||
104 | |||
105 | // -------------------------------------------------------------------------- |
||
106 | |||
107 | /** |
||
108 | * Invalidate method for data consistency |
||
109 | * |
||
110 | * @param mixed $parameter |
||
111 | * @param mixed $variable |
||
112 | * @param int $data_type |
||
113 | * @param mixed $maxlen |
||
114 | * @param array $driverdata |
||
115 | * @return NULL |
||
116 | */ |
||
117 | public function bindParam($parameter, &$variable, $data_type=NULL, $maxlen=NULL, $driverdata=NULL) |
||
121 | |||
122 | // -------------------------------------------------------------------------- |
||
123 | |||
124 | /** |
||
125 | * Invalidate method for data consistency |
||
126 | * |
||
127 | * @param mixed $parameter |
||
128 | * @param mixed $variable |
||
129 | * @param int $data_type |
||
130 | * @return NULL |
||
131 | */ |
||
132 | public function bindValue($parameter, $variable, $data_type=NULL) |
||
136 | |||
137 | // -------------------------------------------------------------------------- |
||
138 | |||
139 | /** |
||
140 | * Run a prepared statement query |
||
141 | * |
||
142 | * @param array $args |
||
143 | * @return Result |
||
144 | */ |
||
145 | public function execute($args = NULL) |
||
157 | |||
158 | // -------------------------------------------------------------------------- |
||
159 | |||
160 | /** |
||
161 | * Emulate PDO fetch public function |
||
162 | * |
||
163 | * @param int $fetch_style |
||
164 | * @param mixed $cursor_orientation |
||
165 | * @param mixed $cursor_offset |
||
166 | * @return mixed |
||
167 | */ |
||
168 | public function fetch($fetch_style=\PDO::FETCH_ASSOC, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset=NULL) |
||
202 | |||
203 | // -------------------------------------------------------------------------- |
||
204 | |||
205 | /** |
||
206 | * Emulate PDO fetchAll public function |
||
207 | * |
||
208 | * @param int $fetch_style |
||
209 | * @param mixed $statement |
||
210 | * @param mixed $ctor_args |
||
211 | * @return mixed |
||
212 | */ |
||
213 | public function fetchAll($fetch_style=\PDO::FETCH_ASSOC, $statement=NULL, $ctor_args=NULL) |
||
226 | |||
227 | // -------------------------------------------------------------------------- |
||
228 | |||
229 | /** |
||
230 | * Emulate PDOStatement::fetchColumn |
||
231 | * |
||
232 | * @param int $column_num |
||
233 | * @return mixed |
||
234 | */ |
||
235 | public function fetchColumn($column_num=0) |
||
240 | |||
241 | // -------------------------------------------------------------------------- |
||
242 | |||
243 | /** |
||
244 | * Emulate PDOStatement::fetchObject, but only for the default use |
||
245 | * |
||
246 | * @param string $class_name |
||
247 | * @param array $ctor_args |
||
248 | * @return stdClass |
||
249 | */ |
||
250 | public function fetchObject($class_name='stdClass', $ctor_args=array()) |
||
254 | |||
255 | // -------------------------------------------------------------------------- |
||
256 | |||
257 | /** |
||
258 | * Return the number of rows affected by the previous query |
||
259 | * |
||
260 | * @return int |
||
261 | */ |
||
262 | public function rowCount() |
||
266 | |||
267 | // -------------------------------------------------------------------------- |
||
268 | |||
269 | /** |
||
270 | * Method to emulate PDOStatement->errorCode |
||
271 | * |
||
272 | * @return string |
||
273 | */ |
||
274 | public function errorCode() |
||
278 | |||
279 | // -------------------------------------------------------------------------- |
||
280 | |||
281 | /** |
||
282 | * Method to emulate PDO->errorInfo / PDOStatement->errorInfo |
||
283 | * |
||
284 | * @return array |
||
285 | */ |
||
286 | public function errorInfo() |
||
290 | } |
||
291 | // End of firebird_result.php |