1 | <?php |
||
15 | abstract class DriverAdapter { |
||
16 | |||
17 | protected $data; |
||
18 | private $insertQuery; |
||
19 | private $updateQuery; |
||
20 | private $modelInstance; |
||
21 | protected $queryEngine; |
||
22 | |||
23 | public function setData($data) { |
||
26 | |||
27 | /** |
||
28 | * Convert datatypes from the database system's native type to a generic type |
||
29 | * supported by nibii. |
||
30 | * |
||
31 | * @param string $nativeType The native datatype |
||
32 | * @return string The generic datatype for use in nibii. |
||
33 | */ |
||
34 | abstract public function mapDataTypes($nativeType); |
||
35 | |||
36 | /** |
||
37 | * |
||
38 | * |
||
39 | * @param type $parameters |
||
40 | * @return type |
||
41 | */ |
||
42 | 26 | public function select($parameters) { |
|
54 | |||
55 | public function count($parameters) { |
||
61 | |||
62 | 4 | private function initInsert() { |
|
66 | |||
67 | 2 | private function initUpdate() { |
|
70 | |||
71 | 4 | public function insert($record) { |
|
77 | |||
78 | 2 | public function update($record) { |
|
84 | |||
85 | 6 | public function bulkUpdate($data, $parameters) { |
|
90 | |||
91 | 2 | public function delete($parameters) { |
|
96 | |||
97 | public function describe($model, $relationships) { |
||
104 | |||
105 | 38 | public static function getDefaultInstance() { |
|
108 | |||
109 | /** |
||
110 | * |
||
111 | * @return \ntentan\nibii\QueryEngine |
||
112 | */ |
||
113 | 34 | private function getQueryEngine() { |
|
120 | |||
121 | 38 | public function setModel($model) { |
|
124 | |||
125 | } |
||
126 |
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.