1 | <?php |
||
32 | abstract class ResultAbstract extends ObjectAbstract implements ResultInterface |
||
33 | { |
||
34 | /** |
||
35 | * Fetched already |
||
36 | * |
||
37 | * @var bool |
||
38 | * @access protected |
||
39 | */ |
||
40 | protected $fetched = false; |
||
41 | |||
42 | /** |
||
43 | * Desctructor |
||
44 | * |
||
45 | * @access public |
||
46 | */ |
||
47 | public function __destruct() |
||
51 | |||
52 | /** |
||
53 | * {@inheritDoc} |
||
54 | */ |
||
55 | public function isSelect()/*# : bool */ |
||
59 | |||
60 | /** |
||
61 | * {@inheritDoc} |
||
62 | */ |
||
63 | public function fetchAll()/*# : array */ |
||
70 | |||
71 | /** |
||
72 | * {@inheritDoc} |
||
73 | */ |
||
74 | public function fetchRow(/*# int */ $rowCount = 1)/*# : array */ |
||
81 | |||
82 | /** |
||
83 | * {@inheritDoc} |
||
84 | */ |
||
85 | public function fetchCol($col = 0, $rowCount = 0)/*# : array */ |
||
96 | |||
97 | /** |
||
98 | * Throw exception if not select query |
||
99 | * |
||
100 | * @throws RuntimeException if not a select query |
||
101 | * @access protected |
||
102 | */ |
||
103 | protected function exceptionIfNotSelect() |
||
112 | |||
113 | /** |
||
114 | * Throw exception if fetched already |
||
115 | * |
||
116 | * @throws RuntimeException if fetched already |
||
117 | * @access protected |
||
118 | */ |
||
119 | protected function exceptionIfFetchedAlready() |
||
128 | |||
129 | /** |
||
130 | * Driver fetch all |
||
131 | * |
||
132 | * @return array |
||
133 | * @access protected |
||
134 | */ |
||
135 | abstract protected function realFetchAll()/*# : array */; |
||
136 | |||
137 | /** |
||
138 | * Driver fetch row |
||
139 | * |
||
140 | * @param int $rowCount number of rows to fetch |
||
141 | * @return array |
||
142 | * @access protected |
||
143 | */ |
||
144 | abstract protected function realFetchRow($rowCount)/*# : array */; |
||
145 | } |
||
146 |