1 | <?php |
||
35 | abstract class StatementAbstract extends ObjectAbstract implements StatementInterface |
||
36 | { |
||
37 | use DriverAwareTrait; |
||
38 | |||
39 | /** |
||
40 | * prepared statement |
||
41 | * |
||
42 | * @var mixed |
||
43 | * @access protected |
||
44 | */ |
||
45 | protected $prepared; |
||
46 | |||
47 | /** |
||
48 | * Result prototype |
||
49 | * |
||
50 | * @var ResultInterface |
||
51 | * @access protected |
||
52 | */ |
||
53 | protected $result_prototype; |
||
54 | |||
55 | /** |
||
56 | * @var ResultInterface |
||
57 | * @access protected |
||
58 | */ |
||
59 | protected $result; |
||
60 | |||
61 | /** |
||
62 | * Desctructor |
||
63 | * |
||
64 | * @access public |
||
65 | */ |
||
66 | public function __destruct() |
||
70 | |||
71 | /** |
||
72 | * {@inheritDoc} |
||
73 | */ |
||
74 | public function prepare(/*# string */ $sql)/*# : bool */ |
||
97 | |||
98 | /** |
||
99 | * {@inheritDoc} |
||
100 | */ |
||
101 | public function execute(array $parameters = [])/*# : bool */ |
||
137 | |||
138 | /** |
||
139 | * {@inheritDoc} |
||
140 | */ |
||
141 | public function getResult()/*# : ResultInterface */ |
||
151 | |||
152 | /** |
||
153 | * {@inheritDoc} |
||
154 | */ |
||
155 | public function close() |
||
162 | |||
163 | /** |
||
164 | * Driver specific prepare statement |
||
165 | * |
||
166 | * @param mixed $link db link resource |
||
167 | * @param string $sql |
||
168 | * @return mixed |
||
169 | * @throws RuntimeException |
||
170 | * @access protected |
||
171 | */ |
||
172 | abstract protected function realPrepare($link, /*# string */ $sql); |
||
173 | |||
174 | /** |
||
175 | * Driver specific statement execution |
||
176 | * |
||
177 | * @param array $parameters |
||
178 | * @return bool |
||
179 | * @throws RuntimeException |
||
180 | * @access protected |
||
181 | */ |
||
182 | abstract protected function realExecute(array $parameters)/*# : bool */; |
||
183 | |||
184 | /** |
||
185 | * Close statement's result set |
||
186 | * |
||
187 | * @param mixed prepared low-level statement |
||
188 | * @access protected |
||
189 | */ |
||
190 | abstract protected function realClose($stmt); |
||
191 | } |
||
192 |