@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | $statement = 'INSERT INTO ' . $table . ' (' . implode(',', $cols) . ') ' . |
| 688 | - 'VALUES (' . implode('),(', $associations) . ')'; |
|
| 688 | + 'VALUES (' . implode('),(', $associations) . ')'; |
|
| 689 | 689 | $this->entityManager->getConnection()->query($statement); |
| 690 | 690 | } |
| 691 | 691 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | $where[] = $this->entityManager->escapeIdentifier($fkCol) . ' = ' . |
| 729 | - $this->entityManager->escapeValue($value); |
|
| 729 | + $this->entityManager->escapeValue($value); |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | foreach ($entities as $entity) { |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | $statement = 'DELETE FROM ' . $table . ' WHERE ' . array_shift($where) . ' ' . |
| 752 | - 'AND (' . implode(' OR ', $where) . ')'; |
|
| 752 | + 'AND (' . implode(' OR ', $where) . ')'; |
|
| 753 | 753 | $this->entityManager->getConnection()->query($statement); |
| 754 | 754 | } |
| 755 | 755 | |
@@ -154,8 +154,7 @@ discard block |
||
| 154 | 154 | $from = $match[3][0] === '-' ? count($words) - substr($match[3], 1) : $match[3]; |
| 155 | 155 | if (isset($words[$from])) { |
| 156 | 156 | return !isset($match[4]) ? |
| 157 | - $words[$from] : |
|
| 158 | - implode('_', array_slice($words, $from)); |
|
| 157 | + $words[$from] : implode('_', array_slice($words, $from)); |
|
| 159 | 158 | } |
| 160 | 159 | return ''; |
| 161 | 160 | }, static::getTableNameTemplate()); |
@@ -677,7 +676,7 @@ discard block |
||
| 677 | 676 | if (empty($associations)) { |
| 678 | 677 | $cols[] = $this->entityManager->escapeIdentifier($fkCol); |
| 679 | 678 | } |
| 680 | - $value = $entity->__get($hisVar); |
|
| 679 | + $value = $entity->__get($hisVar); |
|
| 681 | 680 | |
| 682 | 681 | if ($value === null) { |
| 683 | 682 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
@@ -723,7 +722,7 @@ discard block |
||
| 723 | 722 | $where = []; |
| 724 | 723 | |
| 725 | 724 | foreach ($myRelDef[self::OPT_RELATION_REFERENCE] as $myVar => $fkCol) { |
| 726 | - $value = $this->__get($myVar); |
|
| 725 | + $value = $this->__get($myVar); |
|
| 727 | 726 | |
| 728 | 727 | if ($value === null) { |
| 729 | 728 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
@@ -740,13 +739,13 @@ discard block |
||
| 740 | 739 | |
| 741 | 740 | $condition = []; |
| 742 | 741 | foreach ($oppRelDef[self::OPT_RELATION_REFERENCE] as $hisVar => $fkCol) { |
| 743 | - $value = $entity->__get($hisVar); |
|
| 742 | + $value = $entity->__get($hisVar); |
|
| 744 | 743 | |
| 745 | 744 | if ($value === null) { |
| 746 | 745 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
| 747 | 746 | } |
| 748 | 747 | |
| 749 | - $condition[] = $this->entityManager->escapeIdentifier($fkCol) .' = ' . |
|
| 748 | + $condition[] = $this->entityManager->escapeIdentifier($fkCol) . ' = ' . |
|
| 750 | 749 | $this->entityManager->escapeValue($value); |
| 751 | 750 | } |
| 752 | 751 | $where[] = implode(' AND ', $condition); |
@@ -900,8 +899,7 @@ discard block |
||
| 900 | 899 | } |
| 901 | 900 | |
| 902 | 901 | $reference = !isset($myRelDef[self::OPT_RELATION_TABLE]) ? |
| 903 | - array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) : |
|
| 904 | - $myRelDef[self::OPT_RELATION_REFERENCE]; |
|
| 902 | + array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) : $myRelDef[self::OPT_RELATION_REFERENCE]; |
|
| 905 | 903 | $foreignKey = $this->getForeignKey($reference); |
| 906 | 904 | |
| 907 | 905 | if (!isset($myRelDef[self::OPT_RELATION_TABLE])) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | }, array_values($data)); |
| 240 | 240 | |
| 241 | 241 | $statement = 'INSERT INTO ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 242 | - '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')'; |
|
| 242 | + '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')'; |
|
| 243 | 243 | $pdo = $this->getConnection(); |
| 244 | 244 | |
| 245 | 245 | if ($useAutoIncrement && $entity::isAutoIncremented()) { |
@@ -306,8 +306,8 @@ discard block |
||
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 309 | - 'SET ' . implode(',', $set) . ' ' . |
|
| 310 | - 'WHERE ' . implode(' AND ', $where); |
|
| 309 | + 'SET ' . implode(',', $set) . ' ' . |
|
| 310 | + 'WHERE ' . implode(' AND ', $where); |
|
| 311 | 311 | $this->getConnection()->query($statement); |
| 312 | 312 | |
| 313 | 313 | $this->sync($entity, true); |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 340 | - 'WHERE ' . implode(' AND ', $where); |
|
| 340 | + 'WHERE ' . implode(' AND ', $where); |
|
| 341 | 341 | $this->getConnection()->query($statement); |
| 342 | 342 | |
| 343 | 343 | $entity->setOriginalData([]); |
@@ -440,10 +440,10 @@ |
||
| 440 | 440 | return $this->getConnection()->quote($value); |
| 441 | 441 | |
| 442 | 442 | case 'integer': |
| 443 | - return (string)$value; |
|
| 443 | + return (string) $value; |
|
| 444 | 444 | |
| 445 | 445 | case 'double': |
| 446 | - return (string)$value; |
|
| 446 | + return (string) $value; |
|
| 447 | 447 | |
| 448 | 448 | case 'boolean': |
| 449 | 449 | $connectionType = $this->getConnection()->getAttribute(\PDO::ATTR_DRIVER_NAME); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | protected function createJoin($join, $tableName, $expression, $alias, $args, $empty) |
| 213 | 213 | { |
| 214 | 214 | $join = $join . ' ' . $tableName |
| 215 | - . ($alias ? ' AS ' . $alias : ''); |
|
| 215 | + . ($alias ? ' AS ' . $alias : ''); |
|
| 216 | 216 | |
| 217 | 217 | if (preg_match('/^[A-Za-z_]+$/', $expression)) { |
| 218 | 218 | $join .= ' USING (' . $expression . ')'; |
@@ -325,14 +325,14 @@ discard block |
||
| 325 | 325 | public function getQuery() |
| 326 | 326 | { |
| 327 | 327 | return 'SELECT ' |
| 328 | - . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '') |
|
| 329 | - . ($this->columns ? implode(',', $this->columns) : '*') |
|
| 330 | - . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '') |
|
| 331 | - . (!empty($this->joins) ? ' ' . reset($this->joins) : '') |
|
| 332 | - . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '') |
|
| 333 | - . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '') |
|
| 334 | - . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '') |
|
| 335 | - . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : ''); |
|
| 328 | + . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '') |
|
| 329 | + . ($this->columns ? implode(',', $this->columns) : '*') |
|
| 330 | + . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '') |
|
| 331 | + . (!empty($this->joins) ? ' ' . reset($this->joins) : '') |
|
| 332 | + . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '') |
|
| 333 | + . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '') |
|
| 334 | + . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '') |
|
| 335 | + . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : ''); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** {@inheritdoc} */ |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | /** {@inheritdoc} */ |
| 309 | 309 | public function limit($limit) |
| 310 | 310 | { |
| 311 | - $this->limit = (int)$limit; |
|
| 311 | + $this->limit = (int) $limit; |
|
| 312 | 312 | |
| 313 | 313 | return $this; |
| 314 | 314 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | /** {@inheritdoc} */ |
| 317 | 317 | public function offset($offset) |
| 318 | 318 | { |
| 319 | - $this->offset = (int)$offset; |
|
| 319 | + $this->offset = (int) $offset; |
|
| 320 | 320 | |
| 321 | 321 | return $this; |
| 322 | 322 | } |
@@ -203,7 +203,7 @@ |
||
| 203 | 203 | return null; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $data = $result->fetch(\PDO::FETCH_ASSOC); |
|
| 206 | + $data = $result->fetch(\PDO::FETCH_ASSOC); |
|
| 207 | 207 | |
| 208 | 208 | if (!$data) { |
| 209 | 209 | return null; |