@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * @param string $query |
159 | 159 | * |
160 | - * @return mixed|string |
|
160 | + * @return string |
|
161 | 161 | */ |
162 | 162 | public function replaceTablePlaceholders($query) { |
163 | 163 | $sql = $query; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | - * @param $query |
|
174 | + * @param string $query |
|
175 | 175 | */ |
176 | 176 | protected function logQuery($query) { |
177 | 177 | if (!classSupernova::$config->debug) { |
@@ -286,6 +286,7 @@ discard block |
||
286 | 286 | * @param array $fields |
287 | 287 | * @param array $where |
288 | 288 | * @param bool $isOneRecord |
289 | + * @param boolean $forUpdate |
|
289 | 290 | * |
290 | 291 | * @return array|bool|mysqli_result|null |
291 | 292 | */ |
@@ -331,6 +332,11 @@ discard block |
||
331 | 332 | |
332 | 333 | |
333 | 334 | // INSERT/REPLACE |
335 | + |
|
336 | + /** |
|
337 | + * @param string $table |
|
338 | + * @param integer $replace |
|
339 | + */ |
|
334 | 340 | protected function doSet($table, $fieldsAndValues, $replace = DB_INSERT_PLAIN) { |
335 | 341 | $query = DbQuery::build($this) |
336 | 342 | ->setTable($table) |
@@ -368,6 +374,10 @@ discard block |
||
368 | 374 | |
369 | 375 | |
370 | 376 | // INSERTERS |
377 | + |
|
378 | + /** |
|
379 | + * @param string $query |
|
380 | + */ |
|
371 | 381 | public function doInsertComplex($query) { |
372 | 382 | return $this->doSql($query); |
373 | 383 | } |
@@ -387,7 +397,7 @@ discard block |
||
387 | 397 | * Values should be passed as-is |
388 | 398 | * |
389 | 399 | * @param string $table |
390 | - * @param array $fields |
|
400 | + * @param string[] $fields |
|
391 | 401 | * @param string[] $values |
392 | 402 | * |
393 | 403 | * @return array|bool|mysqli_result|null |
@@ -440,7 +450,7 @@ discard block |
||
440 | 450 | * Self-contained - means no params used |
441 | 451 | * Such queries usually used to make large amount of in-base calculations |
442 | 452 | * |
443 | - * @param $query |
|
453 | + * @param string $query |
|
444 | 454 | * |
445 | 455 | * @return array|bool|mysqli_result|null |
446 | 456 | */ |
@@ -457,13 +467,16 @@ discard block |
||
457 | 467 | } |
458 | 468 | |
459 | 469 | /** |
460 | - * @param $DbQuery DbQuery |
|
470 | + * @param DbQuery $DbQuery DbQuery |
|
461 | 471 | */ |
462 | 472 | public function doUpdateDbQueryAdjust($DbQuery) { |
463 | 473 | return $this->doUpdateDbQuery($DbQuery); |
464 | 474 | } |
465 | 475 | |
466 | 476 | |
477 | + /** |
|
478 | + * @param boolean $isOneRecord |
|
479 | + */ |
|
467 | 480 | protected function doUpdateWhere($table, $fieldsSet, $fieldsAdjust = array(), $where = array(), $isOneRecord = DB_RECORDS_ALL, $whereDanger = array()) { |
468 | 481 | $query = DbQuery::build($this) |
469 | 482 | ->setTable($table) |
@@ -482,6 +495,9 @@ discard block |
||
482 | 495 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORD_ONE); |
483 | 496 | } |
484 | 497 | |
498 | + /** |
|
499 | + * @param string $table |
|
500 | + */ |
|
485 | 501 | public function doUpdateTableSet($table, $fieldsAndValues, $where = array()) { |
486 | 502 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORDS_ALL); |
487 | 503 | } |
@@ -597,6 +613,10 @@ discard block |
||
597 | 613 | } |
598 | 614 | |
599 | 615 | // TODO Заменить это на новый логгер |
616 | + |
|
617 | + /** |
|
618 | + * @param string $query |
|
619 | + */ |
|
600 | 620 | protected function security_watch_user_queries($query) { |
601 | 621 | global $user; |
602 | 622 | |
@@ -620,6 +640,9 @@ discard block |
||
620 | 640 | } |
621 | 641 | |
622 | 642 | |
643 | + /** |
|
644 | + * @param string $query |
|
645 | + */ |
|
623 | 646 | public function security_query_check_bad_words($query) { |
624 | 647 | if ($this->skipQueryCheck) { |
625 | 648 | return; |
@@ -85,6 +85,9 @@ |
||
85 | 85 | return $this->db->doSelectIterator($query); |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $table |
|
90 | + */ |
|
88 | 91 | public function doUpdateRowSetAffected($table, $fieldsAndValues, $where) { |
89 | 92 | $this->db->doUpdateRowSet($table, $fieldsAndValues, $where); |
90 | 93 | return $this->db->db_affected_rows(); |