@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @param string $query |
164 | 164 | * |
165 | - * @return mixed|string |
|
165 | + * @return string |
|
166 | 166 | */ |
167 | 167 | public function replaceTablePlaceholders($query) { |
168 | 168 | $sql = $query; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | - * @param $query |
|
179 | + * @param string $query |
|
180 | 180 | */ |
181 | 181 | protected function logQuery($query) { |
182 | 182 | if (!classSupernova::$config->debug) { |
@@ -306,10 +306,16 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | |
309 | + /** |
|
310 | + * @param string $query |
|
311 | + */ |
|
309 | 312 | public function doInsertComplex($query) { |
310 | 313 | return $this->doExecute($query); |
311 | 314 | } |
312 | 315 | |
316 | + /** |
|
317 | + * @param integer $replace |
|
318 | + */ |
|
313 | 319 | protected function doSet($table, $fieldsAndValues, $replace = DB_INSERT_PLAIN) { |
314 | 320 | $tableSafe = $this->db_escape($table); |
315 | 321 | $safeFieldsAndValues = implode(',', $this->safeFieldsEqualValues($fieldsAndValues)); |
@@ -342,6 +348,9 @@ discard block |
||
342 | 348 | return $this->doSet($table, $fieldsAndValues, $replace); |
343 | 349 | } |
344 | 350 | |
351 | + /** |
|
352 | + * @param string $table |
|
353 | + */ |
|
345 | 354 | public function doReplaceSet($table, $fieldsAndValues) { |
346 | 355 | return $this->doSet($table, $fieldsAndValues, DB_INSERT_REPLACE); |
347 | 356 | } |
@@ -376,7 +385,7 @@ discard block |
||
376 | 385 | * Values should be passed as-is |
377 | 386 | * |
378 | 387 | * @param string $table |
379 | - * @param array $fields |
|
388 | + * @param string[] $fields |
|
380 | 389 | * @param string[] $values |
381 | 390 | * |
382 | 391 | * @return array|bool|mysqli_result|null |
@@ -411,7 +420,7 @@ discard block |
||
411 | 420 | * Self-contained - means no params used |
412 | 421 | * Such queries usually used to make large amount of in-base calculations |
413 | 422 | * |
414 | - * @param $query |
|
423 | + * @param string $query |
|
415 | 424 | * |
416 | 425 | * @return array|bool|mysqli_result|null |
417 | 426 | */ |
@@ -419,6 +428,9 @@ discard block |
||
419 | 428 | return $this->doExecute($query); |
420 | 429 | } |
421 | 430 | |
431 | + /** |
|
432 | + * @param boolean $isOneRecord |
|
433 | + */ |
|
422 | 434 | protected function doUpdateWhere($table, $fieldsSet, $fieldsAdjust = array(), $where = array(), $isOneRecord = DB_RECORDS_ALL) { |
423 | 435 | $tableSafe = $this->db_escape($table); |
424 | 436 | |
@@ -442,18 +454,30 @@ discard block |
||
442 | 454 | return $this->doExecute($query); |
443 | 455 | } |
444 | 456 | |
457 | + /** |
|
458 | + * @param string $table |
|
459 | + */ |
|
445 | 460 | public function doUpdateRowSet($table, $fieldsAndValues, $where) { |
446 | 461 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORD_ONE); |
447 | 462 | } |
448 | 463 | |
464 | + /** |
|
465 | + * @param string $table |
|
466 | + */ |
|
449 | 467 | public function doUpdateTableSet($table, $fieldsAndValues, $where = array()) { |
450 | 468 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORDS_ALL); |
451 | 469 | } |
452 | 470 | |
471 | + /** |
|
472 | + * @param string $table |
|
473 | + */ |
|
453 | 474 | public function doUpdateRowAdjust($table, $fieldsSet, $fieldsAdjust, $where) { |
454 | 475 | return $this->doUpdateWhere($table, $fieldsSet, $fieldsAdjust, $where, DB_RECORD_ONE); |
455 | 476 | } |
456 | 477 | |
478 | + /** |
|
479 | + * @param string $table |
|
480 | + */ |
|
457 | 481 | public function doUpdateTableAdjust($table, $fieldsSet, $fieldsAdjust, $where) { |
458 | 482 | return $this->doUpdateWhere($table, $fieldsSet, $fieldsAdjust, $where, DB_RECORDS_ALL); |
459 | 483 | } |
@@ -526,7 +550,7 @@ discard block |
||
526 | 550 | * |
527 | 551 | * Usually used for mallformed $where conditions |
528 | 552 | * |
529 | - * @param $table |
|
553 | + * @param string $table |
|
530 | 554 | * @param $where |
531 | 555 | * |
532 | 556 | * @return array|bool|mysqli_result|null |
@@ -693,6 +717,10 @@ discard block |
||
693 | 717 | } |
694 | 718 | |
695 | 719 | // TODO Заменить это на новый логгер |
720 | + |
|
721 | + /** |
|
722 | + * @param string $query |
|
723 | + */ |
|
696 | 724 | protected function security_watch_user_queries($query) { |
697 | 725 | global $user; |
698 | 726 | |
@@ -716,6 +744,9 @@ discard block |
||
716 | 744 | } |
717 | 745 | |
718 | 746 | |
747 | + /** |
|
748 | + * @param string $query |
|
749 | + */ |
|
719 | 750 | public function security_query_check_bad_words($query) { |
720 | 751 | if ($this->skipQueryCheck) { |
721 | 752 | return; |