@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getConnection($connName) { |
128 | 128 | if (!isset($this->connections[$connName])) { |
129 | - throw new DBCoreException('Unknown connection: ' . $connName); |
|
129 | + throw new DBCoreException('Unknown connection: '.$connName); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $this->connections[$connName]; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $resultSet[$field->table] = []; |
280 | 280 | } |
281 | 281 | $resultSet[$field->table][$field->name] = $fieldsCounter++; |
282 | - $parameterName = "variable" . $fieldsCounter; //$field->name; |
|
282 | + $parameterName = "variable".$fieldsCounter; //$field->name; |
|
283 | 283 | $$parameterName = null; |
284 | 284 | $parameters[] = &$$parameterName; |
285 | 285 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | */ |
411 | 411 | public static function getTableFieldsList($tableName) { |
412 | 412 | if (!empty($tableName)) { |
413 | - $query = "SHOW FULL COLUMNS FROM " . $tableName; |
|
413 | + $query = "SHOW FULL COLUMNS FROM ".$tableName; |
|
414 | 414 | $stmt = self::doSelectQuery($query); |
415 | 415 | if ($stmt !== false) { |
416 | 416 | $stmt->bind_result( |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | || strpos($type, "datetime") === 0 |
457 | 457 | || strpos($type, "timestamp") === 0 |
458 | 458 | || strpos($type, "date") === 0) { |
459 | - return ('"' . $value . '"'); |
|
459 | + return ('"'.$value.'"'); |
|
460 | 460 | } elseif (strpos($type, "int") === 0 |
461 | 461 | || strpos($type, "tinyint") === 0 |
462 | 462 | || strpos($type, "smallint") === 0 |
@@ -492,17 +492,17 @@ discard block |
||
492 | 492 | $extra = trim($attributes['extra']); |
493 | 493 | $comment = trim($attributes['comment']); |
494 | 494 | |
495 | - $fieldStr = "'" . $field . "' => "; |
|
495 | + $fieldStr = "'".$field."' => "; |
|
496 | 496 | if ($attributes['null'] === 'YES' && is_null($attributes['default'])) { |
497 | - $fieldStr.= "null"; |
|
497 | + $fieldStr .= "null"; |
|
498 | 498 | } else { |
499 | - $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
499 | + $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
500 | 500 | } |
501 | - $fieldStr.= ", // " . $attributes['type'] . |
|
502 | - ", " . (($attributes['null'] == "NO") ? "not null" : "null") |
|
503 | - . ", default '" . $attributes['default'] . "'" . |
|
504 | - ($extra ? ", " . $extra : "") . |
|
505 | - ($comment ? " (" . $comment . ")" : "") . "\n"; |
|
501 | + $fieldStr .= ", // ".$attributes['type']. |
|
502 | + ", ".(($attributes['null'] == "NO") ? "not null" : "null") |
|
503 | + . ", default '".$attributes['default']."'". |
|
504 | + ($extra ? ", ".$extra : ""). |
|
505 | + ($comment ? " (".$comment.")" : "")."\n"; |
|
506 | 506 | |
507 | 507 | return $fieldStr; |
508 | 508 | } |
@@ -557,12 +557,12 @@ discard block |
||
557 | 557 | $idFieldName = $dbObject->getIdFieldName(); |
558 | 558 | |
559 | 559 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
560 | - $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . " |
|
560 | + $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()." |
|
561 | 561 | SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName); |
562 | 562 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
563 | 563 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
564 | 564 | } else { |
565 | - $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . " |
|
565 | + $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()." |
|
566 | 566 | SET " . DBPreparedQuery::sqlQMValuesString($fieldsList); |
567 | 567 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList); |
568 | 568 | $valuesList = self::createValuesList($fieldsList); |
@@ -591,15 +591,15 @@ discard block |
||
591 | 591 | $fieldsList = $dbObject->getFieldsList(); |
592 | 592 | $idFieldName = $dbObject->getIdFieldName(); |
593 | 593 | |
594 | - $query = "UPDATE " . $dbObject->getTableName() . " |
|
595 | - SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName) . " |
|
596 | - WHERE " . $idFieldName . " = ? |
|
594 | + $query = "UPDATE ".$dbObject->getTableName()." |
|
595 | + SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName)." |
|
596 | + WHERE " . $idFieldName." = ? |
|
597 | 597 | LIMIT 1"; |
598 | 598 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
599 | 599 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
600 | - $typesString.= "i"; |
|
600 | + $typesString .= "i"; |
|
601 | 601 | } else { |
602 | - $typesString.= "s"; |
|
602 | + $typesString .= "s"; |
|
603 | 603 | } |
604 | 604 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
605 | 605 | $valuesList[] = $dbObject->getId(); |
@@ -621,8 +621,8 @@ discard block |
||
621 | 621 | */ |
622 | 622 | public static function deleteDBObject($dbObject) { |
623 | 623 | if (!empty($dbObject) && is_object($dbObject)) { |
624 | - $query = "DELETE FROM " . $dbObject->getTableName() . |
|
625 | - " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1"; |
|
624 | + $query = "DELETE FROM ".$dbObject->getTableName(). |
|
625 | + " WHERE ".$dbObject->getIdFieldName()." = ? LIMIT 1"; |
|
626 | 626 | |
627 | 627 | $typesString = "s"; |
628 | 628 | if (Tools::isInteger($dbObject->getId())) { |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | return null; |
675 | 675 | } |
676 | 676 | } elseif ($stmt->num_rows > 1) { |
677 | - throw new DBCoreException("More than single record of '" . $className . "' entity selected"); |
|
677 | + throw new DBCoreException("More than single record of '".$className."' entity selected"); |
|
678 | 678 | } |
679 | 679 | |
680 | 680 | return null; |