1 | <?php |
||
13 | class DbRowDirectOperator { |
||
14 | /** |
||
15 | * @var db_mysql $db |
||
16 | */ |
||
17 | protected $db; |
||
18 | |||
19 | /** |
||
20 | * DbRowDirectOperator constructor. |
||
21 | * |
||
22 | * @param db_mysql $db |
||
23 | */ |
||
24 | public function __construct($db) { |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Builds SELECT DbQuery |
||
31 | * |
||
32 | * @param EntityModel $mEntity |
||
33 | * @param array $where |
||
34 | * @param array $whereDanger |
||
35 | * |
||
36 | * @return DbQuery |
||
37 | */ |
||
38 | protected function buildSelectDbQuery($mEntity, $where, $whereDanger = array()) { |
||
48 | |||
49 | /** |
||
50 | * Gets Iterator for fetching query results |
||
51 | * |
||
52 | * @param EntityModel $model |
||
53 | * @param array $where |
||
54 | * @param array $whereDanger |
||
55 | * |
||
56 | * @return DbResultIterator |
||
57 | */ |
||
58 | public function loadIterator($model, $where, $whereDanger = array()) { |
||
64 | |||
65 | /** |
||
66 | * Returns iterator to iterate through mysqli_result |
||
67 | * |
||
68 | * @param string $strSql |
||
69 | * |
||
70 | * return DbResultIterator |
||
71 | * |
||
72 | * @return DbEmptyIterator|DbMysqliResultIterator |
||
73 | */ |
||
74 | public function doSelectIterator($strSql) { |
||
85 | |||
86 | /** |
||
87 | * @param string $strSql |
||
88 | * |
||
89 | * @return array|null |
||
90 | */ |
||
91 | public function doSelectFetchArray($strSql) { |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @param string $query |
||
98 | * |
||
99 | * @return mixed|null |
||
100 | */ |
||
101 | public function doSelectFetchValue($query) { |
||
106 | |||
107 | |||
108 | |||
109 | |||
110 | |||
111 | |||
112 | |||
113 | |||
114 | |||
115 | |||
116 | |||
117 | |||
118 | |||
119 | |||
120 | |||
121 | /** |
||
122 | * Loads one record according to filter |
||
123 | * |
||
124 | * @param EntityModel $model |
||
125 | * @param array $where |
||
126 | * @param array $whereDanger |
||
127 | * |
||
128 | * @return array|null |
||
129 | */ |
||
130 | public function loadRecord($model, $where, $whereDanger = array()) { |
||
137 | |||
138 | /** |
||
139 | * Gets DB record array by dbId |
||
140 | * |
||
141 | * @param KeyedModel $model |
||
142 | * @param int|string $dbId |
||
143 | * |
||
144 | * @return array|null |
||
145 | */ |
||
146 | public function getById($model, $dbId) { |
||
149 | |||
150 | |||
151 | /** |
||
152 | * @param KeyedModel $mKeyed |
||
153 | * @param int|string $dbId |
||
154 | * |
||
155 | * @return int |
||
156 | */ |
||
157 | public function deleteById($mKeyed, $dbId) { |
||
169 | |||
170 | /** |
||
171 | * @param EntityModel $mEntity |
||
172 | * @param array $row |
||
173 | * |
||
174 | * @return int|string |
||
175 | */ |
||
176 | public function insert($mEntity, $row) { |
||
187 | |||
188 | |||
189 | public function doUpdateRowSetAffected($table, $fieldsAndValues, $where) { |
||
194 | |||
195 | } |
||
196 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.