1 | <?php |
||
15 | abstract class DriverAdapter |
||
16 | { |
||
17 | |||
18 | protected $data; |
||
19 | private $insertQuery; |
||
20 | private $updateQuery; |
||
21 | private $modelInstance; |
||
22 | protected $queryEngine; |
||
23 | |||
24 | public function setData($data) |
||
25 | { |
||
26 | $this->data = $data; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Convert datatypes from the database system's native type to a generic type |
||
31 | * supported by nibii. |
||
32 | * |
||
33 | * @param string $nativeType The native datatype |
||
34 | * @return string The generic datatype for use in nibii. |
||
35 | */ |
||
36 | abstract public function mapDataTypes($nativeType); |
||
37 | |||
38 | /** |
||
39 | * |
||
40 | * |
||
41 | * @param type $parameters |
||
42 | * @return type |
||
43 | */ |
||
44 | 24 | public function select($parameters) |
|
57 | |||
58 | public function count($parameters) |
||
66 | |||
67 | 4 | private function initInsert() |
|
72 | |||
73 | 2 | private function initUpdate() |
|
78 | |||
79 | 4 | public function insert($record) |
|
86 | |||
87 | 2 | public function update($record) |
|
94 | |||
95 | 6 | public function bulkUpdate($data, $parameters) |
|
102 | |||
103 | 2 | public function delete($parameters) |
|
110 | |||
111 | public function describe($model, $relationships) |
||
118 | |||
119 | 32 | public static function getDefaultInstance() |
|
131 | |||
132 | /** |
||
133 | * |
||
134 | * @return \ntentan\nibii\QueryEngine |
||
135 | */ |
||
136 | 32 | private function getQueryEngine() |
|
144 | |||
145 | 10 | public function setModel($model) |
|
149 | } |
||
150 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.