1 | <?php |
||
26 | class ConvertedResultIterator extends ResultIterator |
||
27 | { |
||
28 | protected $types = []; |
||
29 | protected $session; |
||
30 | protected $converters = []; |
||
31 | |||
32 | /** |
||
33 | * @param ResultHandler $result |
||
34 | * @param BaseSession $session |
||
35 | */ |
||
36 | public function __construct(ResultHandler $result, BaseSession $session) |
||
42 | |||
43 | /** |
||
44 | * get |
||
45 | * |
||
46 | * Return a particular result. An array with converted values is returned. |
||
47 | * pg_fetch_array is muted because it produces untrappable warnings on |
||
48 | * errors. |
||
49 | * |
||
50 | * @param integer $index |
||
51 | * @return array |
||
52 | */ |
||
53 | public function get($index) |
||
57 | |||
58 | /** |
||
59 | * initTypes |
||
60 | * |
||
61 | * Get the result types from the result handler. |
||
62 | * |
||
63 | * @return ResultIterator $this |
||
64 | */ |
||
65 | protected function initTypes() |
||
83 | |||
84 | /** |
||
85 | * parseRow |
||
86 | * |
||
87 | * Convert values from Pg. |
||
88 | * |
||
89 | * @param array $values |
||
90 | * @return mixed |
||
91 | */ |
||
92 | protected function parseRow(array $values) |
||
103 | |||
104 | /** |
||
105 | * convertField |
||
106 | * |
||
107 | * Return converted value for a result field. |
||
108 | * |
||
109 | * @param string $name |
||
110 | * @param string $value |
||
111 | * @return mixed |
||
112 | */ |
||
113 | protected function convertField($name, $value) |
||
120 | |||
121 | /** |
||
122 | * slice |
||
123 | * |
||
124 | * see @ResultIterator |
||
125 | */ |
||
126 | public function slice($name) |
||
135 | } |
||
136 |