@@ -243,7 +243,7 @@ |
||
243 | 243 | case ('boolean'): |
244 | 244 | case ('bool'): |
245 | 245 | case ('b'): |
246 | - $_FIELDS[$fieldName] = (boolean) $_FIELDS[$fieldName]; |
|
246 | + $_FIELDS[$fieldName] = (boolean)$_FIELDS[$fieldName]; |
|
247 | 247 | } |
248 | 248 | } else { |
249 | 249 | throw new \Exception("No field '" . $fieldName . "' in global fields list."); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | } else { |
127 | 127 | OutputStream::message(OutputStream::MSG_ERROR, "Number of types is not equal parameters number."); |
128 | 128 | OutputStream::message(OutputStream::MSG_INFO, "T: " . $types); |
129 | - OutputStream::message(OutputStream::MSG_INFO, "A: [" . implode(", ", $params) . "]"); |
|
129 | + OutputStream::message(OutputStream::MSG_INFO, "A: [" . implode(", ", $params) . "]"); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | } else { |
@@ -414,11 +414,11 @@ discard block |
||
414 | 414 | */ |
415 | 415 | if ($this->isNewRecord()) { |
416 | 416 | if (!empty($this->dbQuery->conditions)) { |
417 | - $this->dbQuery->query.= " WHERE "; |
|
417 | + $this->dbQuery->query .= " WHERE "; |
|
418 | 418 | $this->dbQuery->sqlPushValues($this->dbQuery->conditions, " AND "); |
419 | 419 | } |
420 | 420 | } else { |
421 | - $this->dbQuery->query.= " WHERE "; |
|
421 | + $this->dbQuery->query .= " WHERE "; |
|
422 | 422 | $this->dbQuery->sqlPushValues([static::ID_FIELD_NAME => $this->id]); |
423 | 423 | } |
424 | 424 | |
@@ -427,14 +427,14 @@ discard block |
||
427 | 427 | */ |
428 | 428 | if ($this->isNewRecord()) { |
429 | 429 | if (!empty($this->dbQuery->order)) { |
430 | - $this->dbQuery->query.= " ORDER BY"; |
|
430 | + $this->dbQuery->query .= " ORDER BY"; |
|
431 | 431 | if (is_array($this->dbQuery->order)) { |
432 | 432 | foreach ($this->dbQuery->order as $fieldName => $ord) { |
433 | - $this->dbQuery->query.= " " . $fieldName . " " . $ord . ","; |
|
433 | + $this->dbQuery->query .= " " . $fieldName . " " . $ord . ","; |
|
434 | 434 | } |
435 | 435 | $this->dbQuery->query = substr($this->dbQuery->query, 0, strlen($this->dbQuery->query) - 1); |
436 | 436 | } elseif (is_string($this->dbQuery->order)) { |
437 | - $this->dbQuery->query.= " " . $this->dbQuery->order; |
|
437 | + $this->dbQuery->query .= " " . $this->dbQuery->order; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | } |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | if ($this->isNewRecord()) { |
447 | 447 | if (!is_null($this->dbQuery->limit)) { |
448 | 448 | if (Tools::isInteger($this->dbQuery->limit)) { |
449 | - $this->dbQuery->query.= " LIMIT " . $this->dbQuery->limit; |
|
449 | + $this->dbQuery->query .= " LIMIT " . $this->dbQuery->limit; |
|
450 | 450 | $count = $this->dbQuery->limit; |
451 | 451 | } elseif (is_array($this->dbQuery->limit) && count($this->dbQuery->limit) == 2) { |
452 | 452 | $offset = $this->dbQuery->limit[0]; |
453 | 453 | $count = $this->dbQuery->limit[1]; |
454 | 454 | if (Tools::isInteger($offset) && Tools::isInteger($count)) { |
455 | - $this->dbQuery->query.= " LIMIT " . $offset . ", " . $count; |
|
455 | + $this->dbQuery->query .= " LIMIT " . $offset . ", " . $count; |
|
456 | 456 | } else { |
457 | 457 | throw new DBCoreException("Invalid LIMIT param in select() method."); |
458 | 458 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | } |
463 | 463 | } else { |
464 | - $this->dbQuery->query.= " LIMIT 1"; |
|
464 | + $this->dbQuery->query .= " LIMIT 1"; |
|
465 | 465 | $count = 1; |
466 | 466 | } |
467 | 467 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function selectDBObject($debug = false) { |
105 | 105 | $query = "SELECT * FROM " . $this->dbObject->getTableName() . |
106 | - ($this->conditions != ""?" WHERE " . $this->conditions:"") . " LIMIT 1"; |
|
106 | + ($this->conditions != "" ? " WHERE " . $this->conditions : "") . " LIMIT 1"; |
|
107 | 107 | |
108 | 108 | if (!$debug) { |
109 | 109 | $stmt = DBCore::doSelectQuery($query); |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | $query .= " AND " . $this->conditions; |
137 | 137 | } |
138 | 138 | |
139 | - $query.= $this->getQueryOrderSQL(); |
|
140 | - $query.= " LIMIT 1"; |
|
139 | + $query .= $this->getQueryOrderSQL(); |
|
140 | + $query .= " LIMIT 1"; |
|
141 | 141 | |
142 | 142 | $fieldType = DBField::getType($fieldValue); |
143 | 143 | if (!$debug) { |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | * @return array<DBObject> |
179 | 179 | */ |
180 | 180 | public function selectDBObjects($debug = false) { |
181 | - $query = "SELECT" . ($this->unique?" DISTINCT":"") . " * FROM " . $this->dbObject->getTableName(); |
|
181 | + $query = "SELECT" . ($this->unique ? " DISTINCT" : "") . " * FROM " . $this->dbObject->getTableName(); |
|
182 | 182 | |
183 | 183 | if ($this->conditions != "") { |
184 | 184 | $query .= " WHERE " . $this->conditions; |
185 | 185 | } |
186 | 186 | |
187 | - $query.= $this->getQueryOrderSQL(); |
|
188 | - $query.= $this->getQueryLimitSQL(); |
|
187 | + $query .= $this->getQueryOrderSQL(); |
|
188 | + $query .= $this->getQueryLimitSQL(); |
|
189 | 189 | |
190 | 190 | if (!$debug) { |
191 | 191 | $stmt = DBCore::doSelectQuery($query); |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | $query .= " AND " . $this->conditions; |
220 | 220 | } |
221 | 221 | |
222 | - $query.= $this->getQueryOrderSQL(); |
|
223 | - $query.= $this->getQueryLimitSQL(); |
|
222 | + $query .= $this->getQueryOrderSQL(); |
|
223 | + $query .= $this->getQueryLimitSQL(); |
|
224 | 224 | |
225 | 225 | $fieldType = DBField::getType($fieldValue); |
226 | 226 | if (!$debug) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | break; |
107 | 107 | case ("IN"): |
108 | 108 | case ("NOT IN"): |
109 | - if (is_array($value) && !empty($value)) { |
|
109 | + if (is_array($value) && !empty($value)) { |
|
110 | 110 | $dataList = []; |
111 | 111 | foreach ($value as $dataItem) { |
112 | 112 | $dataList[] = DBField::sqlValue($this->field->type, $dataItem); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | if ($count > 0) { |
117 | 117 | $qmStr = "?"; |
118 | 118 | $tStr = $this->field->type; |
119 | - for ($i = 1; $i < $count; $i ++) { |
|
119 | + for ($i = 1; $i < $count; $i++) { |
|
120 | 120 | $qmStr .= ", ?"; |
121 | 121 | $tStr .= $this->field->type; |
122 | 122 | } |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | $extra = trim($attributes['extra']); |
473 | 473 | $comment = trim($attributes['comment']); |
474 | 474 | |
475 | - $fieldStr= "'" . $field . "' => "; |
|
475 | + $fieldStr = "'" . $field . "' => "; |
|
476 | 476 | if ($attributes['null'] === 'YES' && is_null($attributes['default'])) { |
477 | - $fieldStr.= "null"; |
|
477 | + $fieldStr .= "null"; |
|
478 | 478 | } else { |
479 | - $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
479 | + $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
480 | 480 | } |
481 | - $fieldStr.= ", // " . $attributes['type'] . |
|
481 | + $fieldStr .= ", // " . $attributes['type'] . |
|
482 | 482 | ", " . (($attributes['null'] == "NO") ? "not null" : "null") |
483 | 483 | . ", default '" . $attributes['default'] . "'" . |
484 | 484 | ($extra ? ", " . $extra : "") . |
@@ -573,9 +573,9 @@ discard block |
||
573 | 573 | LIMIT 1"; |
574 | 574 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
575 | 575 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
576 | - $typesString.= "i"; |
|
576 | + $typesString .= "i"; |
|
577 | 577 | } else { |
578 | - $typesString.= "s"; |
|
578 | + $typesString .= "s"; |
|
579 | 579 | } |
580 | 580 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
581 | 581 | $valuesList[] = $dbObject->getId(); |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | throw new DBCoreException("Class with name '" . $className . "' is not exists"); |
918 | 918 | } |
919 | 919 | |
920 | - $query = "UPDATE " . $dbObject->getTableName() . " SET `" . $activationFieldName . "` = '" . $activationValue ."' |
|
920 | + $query = "UPDATE " . $dbObject->getTableName() . " SET `" . $activationFieldName . "` = '" . $activationValue . "' |
|
921 | 921 | WHERE " . $dbObject->getIdFieldName() . " IN (" . DBPreparedQuery::sqlQMString($itemsNumber) . ")"; |
922 | 922 | |
923 | 923 | return self::doUpdateQuery($query, $types, $idsList); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $chunks = []; |
200 | 200 | foreach (array_keys($fieldsList) as $fieldName) { |
201 | 201 | if ($fieldName != $idFieldName) { |
202 | - $chunks[]= "`" . $fieldName . "` = ?"; |
|
202 | + $chunks[] = "`" . $fieldName . "` = ?"; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | return implode(", ", $chunks); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $chunks = []; |
218 | 218 | foreach ($fieldsList as $fieldName => $fieldValue) { |
219 | 219 | if ($fieldName != $idFieldName) { |
220 | - $chunks[]= "`" . $fieldName . "` = '" . $fieldValue . "'"; |
|
220 | + $chunks[] = "`" . $fieldName . "` = '" . $fieldValue . "'"; |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | return implode(", ", $chunks); |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | foreach ($fieldsList as $fieldName => $fieldValue) { |
241 | 241 | if ($fieldName != $idFieldName) { |
242 | 242 | if (Tools::isDouble($fieldValue)) { |
243 | - $typesString.= "d"; |
|
243 | + $typesString .= "d"; |
|
244 | 244 | } elseif (Tools::isInteger($fieldValue)) { |
245 | - $typesString.= "i"; |
|
245 | + $typesString .= "i"; |
|
246 | 246 | } else { |
247 | - $typesString.= "s"; |
|
247 | + $typesString .= "s"; |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $type = DBField::castType($type); |
265 | 265 | $typesString = ""; |
266 | 266 | while ($length > 0) { |
267 | - $typesString.= $type; |
|
267 | + $typesString .= $type; |
|
268 | 268 | $length--; |
269 | 269 | } |
270 | 270 | |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | foreach ($values as $fieldName => $fieldValue) { |
284 | 284 | if (!is_array($fieldValue)) { |
285 | 285 | if (!is_null($fieldValue)) { |
286 | - $chunks[]= $fieldName . " = ?"; |
|
287 | - $this->types.= DBField::getType($fieldValue); |
|
286 | + $chunks[] = $fieldName . " = ?"; |
|
287 | + $this->types .= DBField::getType($fieldValue); |
|
288 | 288 | $this->params[] = $fieldValue; |
289 | 289 | } else { |
290 | - $chunks[]= $fieldName; |
|
290 | + $chunks[] = $fieldName; |
|
291 | 291 | } |
292 | 292 | } else { |
293 | 293 | $condition = $fieldName; |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | |
296 | 296 | $chunks[] = $condition; |
297 | 297 | foreach ($localParams as $param) { |
298 | - $this->types.= DBField::getType($param); |
|
298 | + $this->types .= DBField::getType($param); |
|
299 | 299 | $this->params[] = $param; |
300 | 300 | } |
301 | 301 | } |
302 | 302 | } |
303 | - $this->query.= implode($separator, $chunks); |
|
303 | + $this->query .= implode($separator, $chunks); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | } |
@@ -149,7 +149,7 @@ |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | $array = &$array[$key]; |
152 | - } elseif(isset($array[$key])) { // last element |
|
152 | + } elseif (isset($array[$key])) { // last element |
|
153 | 153 | unset($array[$key]); |
154 | 154 | } |
155 | 155 | } |
@@ -89,11 +89,11 @@ |
||
89 | 89 | */ |
90 | 90 | protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = "") { |
91 | 91 | $headers = "From: " . $this->fromName . " <" . $this->fromEmail . ">\r\n"; |
92 | - $headers.= "Reply-To: " . $replyTo . "\r\n"; |
|
92 | + $headers .= "Reply-To: " . $replyTo . "\r\n"; |
|
93 | 93 | |
94 | 94 | if ($format == self::FORMAT_HTML) { |
95 | - $headers.= "MIME-Version: 1.0\r\n"; |
|
96 | - $headers.= "Content-type: text/html; charset=utf-8\r\n"; |
|
95 | + $headers .= "MIME-Version: 1.0\r\n"; |
|
96 | + $headers .= "Content-type: text/html; charset=utf-8\r\n"; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |