@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Sets primary key value. |
| 55 | 55 | * |
| 56 | - * @param mixed $recordId Key vaue. |
|
| 56 | + * @param integer $recordId Key vaue. |
|
| 57 | 57 | * |
| 58 | - * @return bool Success flag. |
|
| 58 | + * @return DBObject Success flag. |
|
| 59 | 59 | * @throws DBCoreException If object has no field with such name. |
| 60 | 60 | */ |
| 61 | 61 | public function setId($recordId) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @param bool $ignore Ignore unique indexes or not. |
| 256 | 256 | * @param bool Debug mode flag. |
| 257 | 257 | * |
| 258 | - * @return mixed Primary key value. |
|
| 258 | + * @return integer Primary key value. |
|
| 259 | 259 | * @throws DBCoreException If some database error occurred. |
| 260 | 260 | */ |
| 261 | 261 | public function insert($ignore = false, $debug = false) { |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | /** |
| 515 | 515 | * Deletes DB record for current DBObject. |
| 516 | 516 | * |
| 517 | - * @return mixed Number of affected rows (1 if some record was deleted, |
|
| 517 | + * @return integer Number of affected rows (1 if some record was deleted, |
|
| 518 | 518 | * 0 - if no) or FALSE if some error occurred. |
| 519 | 519 | */ |
| 520 | 520 | public function delete() { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * @return mixed Primary key value. |
| 259 | 259 | * @throws DBCoreException If some database error occurred. |
| 260 | 260 | */ |
| 261 | - public function insert($ignore = false, $debug = false) { |
|
| 261 | + public function insert($ignore = false, $debug = false) { |
|
| 262 | 262 | return DBCore::insertDBObject($this, $ignore, $debug); |
| 263 | 263 | } |
| 264 | 264 | |
@@ -430,11 +430,11 @@ discard block |
||
| 430 | 430 | */ |
| 431 | 431 | if ($this->isNewRecord()) { |
| 432 | 432 | if (!empty($this->dbQuery->conditions)) { |
| 433 | - $this->dbQuery->query.= " WHERE "; |
|
| 433 | + $this->dbQuery->query .= " WHERE "; |
|
| 434 | 434 | $this->dbQuery->sqlPushValues($this->dbQuery->conditions, " AND "); |
| 435 | 435 | } |
| 436 | 436 | } else { |
| 437 | - $this->dbQuery->query.= " WHERE "; |
|
| 437 | + $this->dbQuery->query .= " WHERE "; |
|
| 438 | 438 | $this->dbQuery->sqlPushValues([static::ID_FIELD_NAME => $this->id]); |
| 439 | 439 | } |
| 440 | 440 | |
@@ -443,14 +443,14 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | if ($this->isNewRecord()) { |
| 445 | 445 | if (!empty($this->dbQuery->order)) { |
| 446 | - $this->dbQuery->query.= " ORDER BY"; |
|
| 446 | + $this->dbQuery->query .= " ORDER BY"; |
|
| 447 | 447 | if (is_array($this->dbQuery->order)) { |
| 448 | 448 | foreach ($this->dbQuery->order as $fieldName => $ord) { |
| 449 | - $this->dbQuery->query.= " " . $fieldName . " " . $ord . ","; |
|
| 449 | + $this->dbQuery->query .= " " . $fieldName . " " . $ord . ","; |
|
| 450 | 450 | } |
| 451 | 451 | $this->dbQuery->query = substr($this->dbQuery->query, 0, strlen($this->dbQuery->query) - 1); |
| 452 | 452 | } elseif (is_string($this->dbQuery->order)) { |
| 453 | - $this->dbQuery->query.= " " . $this->dbQuery->order; |
|
| 453 | + $this->dbQuery->query .= " " . $this->dbQuery->order; |
|
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | } |
@@ -462,13 +462,13 @@ discard block |
||
| 462 | 462 | if ($this->isNewRecord()) { |
| 463 | 463 | if (!is_null($this->dbQuery->limit)) { |
| 464 | 464 | if (Tools::isInteger($this->dbQuery->limit)) { |
| 465 | - $this->dbQuery->query.= " LIMIT " . $this->dbQuery->limit; |
|
| 465 | + $this->dbQuery->query .= " LIMIT " . $this->dbQuery->limit; |
|
| 466 | 466 | $count = $this->dbQuery->limit; |
| 467 | 467 | } elseif (is_array($this->dbQuery->limit) && count($this->dbQuery->limit) == 2) { |
| 468 | 468 | $offset = $this->dbQuery->limit[0]; |
| 469 | 469 | $count = $this->dbQuery->limit[1]; |
| 470 | 470 | if (Tools::isInteger($offset) && Tools::isInteger($count)) { |
| 471 | - $this->dbQuery->query.= " LIMIT " . $offset . ", " . $count; |
|
| 471 | + $this->dbQuery->query .= " LIMIT " . $offset . ", " . $count; |
|
| 472 | 472 | } else { |
| 473 | 473 | throw new DBCoreException("Invalid LIMIT param in select() method."); |
| 474 | 474 | } |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | } else { |
| 480 | - $this->dbQuery->query.= " LIMIT 1"; |
|
| 480 | + $this->dbQuery->query .= " LIMIT 1"; |
|
| 481 | 481 | $count = 1; |
| 482 | 482 | } |
| 483 | 483 | |
@@ -495,11 +495,11 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | $fieldStr = "'" . $field . "' => "; |
| 497 | 497 | if ($attributes['null'] === 'YES' && is_null($attributes['default'])) { |
| 498 | - $fieldStr.= "null"; |
|
| 498 | + $fieldStr .= "null"; |
|
| 499 | 499 | } else { |
| 500 | - $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
| 500 | + $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
| 501 | 501 | } |
| 502 | - $fieldStr.= ", // " . $attributes['type'] . |
|
| 502 | + $fieldStr .= ", // " . $attributes['type'] . |
|
| 503 | 503 | ", " . (($attributes['null'] == "NO") ? "not null" : "null") |
| 504 | 504 | . ", default '" . $attributes['default'] . "'" . |
| 505 | 505 | ($extra ? ", " . $extra : "") . |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | * |
| 554 | 554 | * @return int Insertion ID (primary key value) or null on debug. |
| 555 | 555 | */ |
| 556 | - public static function insertDBObject($dbObject, $ignore = false, $debug = false) { |
|
| 556 | + public static function insertDBObject($dbObject, $ignore = false, $debug = false) { |
|
| 557 | 557 | $fieldsList = $dbObject->getFieldsList(); |
| 558 | 558 | $idFieldName = $dbObject->getIdFieldName(); |
| 559 | 559 | |
@@ -598,9 +598,9 @@ discard block |
||
| 598 | 598 | LIMIT 1"; |
| 599 | 599 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
| 600 | 600 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
| 601 | - $typesString.= "i"; |
|
| 601 | + $typesString .= "i"; |
|
| 602 | 602 | } else { |
| 603 | - $typesString.= "s"; |
|
| 603 | + $typesString .= "s"; |
|
| 604 | 604 | } |
| 605 | 605 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
| 606 | 606 | $valuesList[] = $dbObject->getId(); |