| @@ -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 | */ | 
| @@ -332,6 +333,11 @@ discard block | ||
| 332 | 333 | |
| 333 | 334 | |
| 334 | 335 | // INSERT/REPLACE | 
| 336 | + | |
| 337 | + /** | |
| 338 | + * @param string $table | |
| 339 | + * @param integer $replace | |
| 340 | + */ | |
| 335 | 341 |    protected function doSet($table, $fieldsAndValues, $replace = DB_INSERT_PLAIN) { | 
| 336 | 342 | $query = DbQuery::build($this) | 
| 337 | 343 | ->setTable($table) | 
| @@ -369,6 +375,10 @@ discard block | ||
| 369 | 375 | |
| 370 | 376 | |
| 371 | 377 | // INSERTERS | 
| 378 | + | |
| 379 | + /** | |
| 380 | + * @param string $query | |
| 381 | + */ | |
| 372 | 382 |    public function doInsertComplex($query) { | 
| 373 | 383 | return $this->doSql($query); | 
| 374 | 384 | } | 
| @@ -386,7 +396,7 @@ discard block | ||
| 386 | 396 | * Values should be passed as-is | 
| 387 | 397 | * | 
| 388 | 398 | * @param string $table | 
| 389 | - * @param array $fields | |
| 399 | + * @param string[] $fields | |
| 390 | 400 | * @param string[] $values | 
| 391 | 401 | * | 
| 392 | 402 | * @return array|bool|mysqli_result|null | 
| @@ -438,7 +448,7 @@ discard block | ||
| 438 | 448 | * Self-contained - means no params used | 
| 439 | 449 | * Such queries usually used to make large amount of in-base calculations | 
| 440 | 450 | * | 
| 441 | - * @param $query | |
| 451 | + * @param string $query | |
| 442 | 452 | * | 
| 443 | 453 | * @return array|bool|mysqli_result|null | 
| 444 | 454 | */ | 
| @@ -456,13 +466,16 @@ discard block | ||
| 456 | 466 | } | 
| 457 | 467 | |
| 458 | 468 | /** | 
| 459 | - * @param $DbQuery DbQuery | |
| 469 | + * @param DbQuery $DbQuery DbQuery | |
| 460 | 470 | */ | 
| 461 | 471 |    public function doUpdateDbQueryAdjust($DbQuery) { | 
| 462 | 472 | return $this->doUpdateDbQuery($DbQuery); | 
| 463 | 473 | } | 
| 464 | 474 | |
| 465 | 475 | |
| 476 | + /** | |
| 477 | + * @param boolean $isOneRecord | |
| 478 | + */ | |
| 466 | 479 |    protected function doUpdateWhere($table, $fieldsSet, $fieldsAdjust = array(), $where = array(), $isOneRecord = DB_RECORDS_ALL, $whereDanger = array()) { | 
| 467 | 480 | // $query = DbQuery::build($this) | 
| 468 | 481 | // ->setTable($table) | 
| @@ -498,10 +511,16 @@ discard block | ||
| 498 | 511 | return $this->doSql($query); | 
| 499 | 512 | } | 
| 500 | 513 | |
| 514 | + /** | |
| 515 | + * @param string $table | |
| 516 | + */ | |
| 501 | 517 |    public function doUpdateRowSet($table, $fieldsAndValues, $where) { | 
| 502 | 518 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORD_ONE); | 
| 503 | 519 | } | 
| 504 | 520 | |
| 521 | + /** | |
| 522 | + * @param string $table | |
| 523 | + */ | |
| 505 | 524 |    public function doUpdateTableSet($table, $fieldsAndValues, $where = array()) { | 
| 506 | 525 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORDS_ALL); | 
| 507 | 526 | } | 
| @@ -708,6 +727,10 @@ discard block | ||
| 708 | 727 | } | 
| 709 | 728 | |
| 710 | 729 | // TODO Заменить это на новый логгер | 
| 730 | + | |
| 731 | + /** | |
| 732 | + * @param string $query | |
| 733 | + */ | |
| 711 | 734 |    protected function security_watch_user_queries($query) { | 
| 712 | 735 | global $user; | 
| 713 | 736 | |
| @@ -731,6 +754,9 @@ discard block | ||
| 731 | 754 | } | 
| 732 | 755 | |
| 733 | 756 | |
| 757 | + /** | |
| 758 | + * @param string $query | |
| 759 | + */ | |
| 734 | 760 |    public function security_query_check_bad_words($query) { | 
| 735 | 761 |      if ($this->skipQueryCheck) { | 
| 736 | 762 | return; | 
| @@ -155,10 +155,17 @@ discard block | ||
| 155 | 155 | return $this->field(DbSqlLiteral::build($this->db)->literal($field)); | 
| 156 | 156 | } | 
| 157 | 157 | |
| 158 | + /** | |
| 159 | + * @param string $functionName | |
| 160 | + * @param string $alias | |
| 161 | + */ | |
| 158 | 162 |    public function fieldSingleFunction($functionName, $field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { | 
| 159 | 163 | return $this->field(DbSqlLiteral::build($this->db)->buildSingleArgument($functionName, $field, $alias)); | 
| 160 | 164 | } | 
| 161 | 165 | |
| 166 | + /** | |
| 167 | + * @param string $alias | |
| 168 | + */ | |
| 162 | 169 |    public function fieldCount($field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { | 
| 163 | 170 | return $this->field(DbSqlLiteral::build($this->db)->count($field, $alias)); | 
| 164 | 171 | } | 
| @@ -240,7 +247,7 @@ discard block | ||
| 240 | 247 | |
| 241 | 248 | /** | 
| 242 | 249 | * @param db_mysql|null $db | 
| 243 | - * @param string|object|DBStaticRecord|DbSqlAware $className | |
| 250 | + * @param string $className | |
| 244 | 251 | * | 
| 245 | 252 | * @return static | 
| 246 | 253 | */ | 
| @@ -444,7 +451,6 @@ discard block | ||
| 444 | 451 | } | 
| 445 | 452 | |
| 446 | 453 | /** | 
| 447 | - * @param bool $skip_query_check | |
| 448 | 454 | * | 
| 449 | 455 | * @return array | 
| 450 | 456 | */ | 
| @@ -455,7 +461,6 @@ discard block | ||
| 455 | 461 | } | 
| 456 | 462 | |
| 457 | 463 | /** | 
| 458 | - * @param bool $skip_query_check | |
| 459 | 464 | * | 
| 460 | 465 | * @return mixed|null | 
| 461 | 466 | */ | 
| @@ -230,7 +230,7 @@ | ||
| 230 | 230 |                array("distinct({{{$location_info[P_TABLE_NAME]}}}.{$owner_data[P_OWNER_FIELD]}) AS parent_id"), | 
| 231 | 231 | $filter, | 
| 232 | 232 | // Always selecting all records for correctly perform FILTER locks | 
| 233 | - $fetch ? DB_RECORD_ONE : DB_RECORDS_ALL, | |
| 233 | + $fetch ? DB_RECORD_ONE : DB_RECORDS_ALL, | |
| 234 | 234 | // DB_RECORDS_ALL, | 
| 235 | 235 | DB_SELECT_PLAIN | 
| 236 | 236 | ); |