@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function generate(EntityManager $em, $entity) |
36 | 36 | { |
37 | 37 | $conn = $em->getConnection(); |
38 | - $sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression(); |
|
38 | + $sql = 'SELECT '.$conn->getDatabasePlatform()->getGuidExpression(); |
|
39 | 39 | |
40 | 40 | return $conn->query($sql)->fetchColumn(0); |
41 | 41 | } |
@@ -95,15 +95,15 @@ |
||
95 | 95 | $expressionList[] = $this->dispatch($child); |
96 | 96 | } |
97 | 97 | |
98 | - switch($expr->getType()) { |
|
98 | + switch ($expr->getType()) { |
|
99 | 99 | case CompositeExpression::TYPE_AND: |
100 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
100 | + return '('.implode(' AND ', $expressionList).')'; |
|
101 | 101 | |
102 | 102 | case CompositeExpression::TYPE_OR: |
103 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
103 | + return '('.implode(' OR ', $expressionList).')'; |
|
104 | 104 | |
105 | 105 | default: |
106 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
106 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | static public function matchingAssocationFieldRequiresObject($class, $associationName) |
30 | 30 | { |
31 | 31 | return new self(sprintf( |
32 | - "Cannot match on %s::%s with a non-object value. Matching objects by id is " . |
|
32 | + "Cannot match on %s::%s with a non-object value. Matching objects by id is ". |
|
33 | 33 | "not compatible with matching on an in-memory collection, which compares objects by reference.", |
34 | 34 | $class, $associationName |
35 | 35 | )); |
@@ -147,9 +147,9 @@ |
||
147 | 147 | return (bool) $persister->count($criteria); |
148 | 148 | } |
149 | 149 | |
150 | - /** |
|
151 | - * {@inheritdoc} |
|
152 | - */ |
|
150 | + /** |
|
151 | + * {@inheritdoc} |
|
152 | + */ |
|
153 | 153 | public function contains(PersistentCollection $collection, $element) |
154 | 154 | { |
155 | 155 | if ( ! $this->isValidEntityState($element)) { |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | $parameters[] = $identifier[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])]; |
218 | 218 | } |
219 | 219 | |
220 | - $statement = 'DELETE FROM ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
221 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
220 | + $statement = 'DELETE FROM '.$this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
221 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
222 | 222 | |
223 | 223 | return $this->conn->executeUpdate($statement, $parameters); |
224 | 224 | } |
@@ -255,18 +255,18 @@ discard block |
||
255 | 255 | ]; |
256 | 256 | } |
257 | 257 | |
258 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
259 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
258 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
259 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
260 | 260 | |
261 | 261 | $this->conn->executeUpdate($statement); |
262 | 262 | |
263 | 263 | // 2) Build insert table records into temporary table |
264 | 264 | $query = $this->em->createQuery( |
265 | - ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
266 | - . ' FROM ' . $targetClass->name . ' t0 WHERE t0.' . $mapping['mappedBy'] . ' = :owner' |
|
265 | + ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
266 | + . ' FROM '.$targetClass->name.' t0 WHERE t0.'.$mapping['mappedBy'].' = :owner' |
|
267 | 267 | )->setParameter('owner', $collection->getOwner()); |
268 | 268 | |
269 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ') ' . $query->getSQL(); |
|
269 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnList.') '.$query->getSQL(); |
|
270 | 270 | $parameters = array_values($sourceClass->getIdentifierValues($collection->getOwner())); |
271 | 271 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
272 | 272 | |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | |
276 | 276 | foreach (array_reverse($classNames) as $className) { |
277 | 277 | $tableName = $this->quoteStrategy->getTableName($this->em->getClassMetadata($className), $this->platform); |
278 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnList . ')' |
|
279 | - . ' IN (SELECT ' . $idColumnList . ' FROM ' . $tempTable . ')'; |
|
278 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnList.')' |
|
279 | + . ' IN (SELECT '.$idColumnList.' FROM '.$tempTable.')'; |
|
280 | 280 | |
281 | 281 | $this->conn->executeUpdate($statement); |
282 | 282 | } |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | |
340 | 340 | // FIXME: Order with composite keys might not be correct |
341 | 341 | $sql = 'SELECT ' . $columnName |
342 | - . ' FROM ' . $tableName |
|
343 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
342 | + . ' FROM ' . $tableName |
|
343 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
344 | 344 | |
345 | 345 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
346 | 346 | |
@@ -474,8 +474,8 @@ discard block |
||
474 | 474 | } |
475 | 475 | |
476 | 476 | $sql = 'UPDATE ' . $quotedTableName |
477 | - . ' SET ' . implode(', ', $set) |
|
478 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
477 | + . ' SET ' . implode(', ', $set) |
|
478 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
479 | 479 | |
480 | 480 | $result = $this->conn->executeUpdate($sql, $params, $types); |
481 | 481 | |
@@ -1528,9 +1528,9 @@ discard block |
||
1528 | 1528 | $lock = $this->getLockTablesSql($lockMode); |
1529 | 1529 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1530 | 1530 | $sql = 'SELECT 1 ' |
1531 | - . $lock |
|
1532 | - . $where |
|
1533 | - . $lockSql; |
|
1531 | + . $lock |
|
1532 | + . $where |
|
1533 | + . $lockSql; |
|
1534 | 1534 | |
1535 | 1535 | list($params, $types) = $this->expandParameters($criteria); |
1536 | 1536 | |
@@ -1981,8 +1981,8 @@ discard block |
||
1981 | 1981 | $alias = $this->getSQLTableAlias($this->class->name); |
1982 | 1982 | |
1983 | 1983 | $sql = 'SELECT 1 ' |
1984 | - . $this->getLockTablesSql(null) |
|
1985 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1984 | + . $this->getLockTablesSql(null) |
|
1985 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1986 | 1986 | |
1987 | 1987 | list($params, $types) = $this->expandParameters($criteria); |
1988 | 1988 | |
@@ -2012,9 +2012,9 @@ discard block |
||
2012 | 2012 | { |
2013 | 2013 | // if one of the join columns is nullable, return left join |
2014 | 2014 | foreach ($joinColumns as $joinColumn) { |
2015 | - if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) { |
|
2016 | - return 'LEFT JOIN'; |
|
2017 | - } |
|
2015 | + if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) { |
|
2016 | + return 'LEFT JOIN'; |
|
2017 | + } |
|
2018 | 2018 | } |
2019 | 2019 | |
2020 | 2020 | return 'INNER JOIN'; |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
341 | 341 | |
342 | 342 | // FIXME: Order with composite keys might not be correct |
343 | - $sql = 'SELECT ' . $columnName |
|
344 | - . ' FROM ' . $tableName |
|
345 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
343 | + $sql = 'SELECT '.$columnName |
|
344 | + . ' FROM '.$tableName |
|
345 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
346 | 346 | |
347 | 347 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
348 | 348 | |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | $params[] = $value; |
421 | - $set[] = $column . ' = ' . $placeholder; |
|
421 | + $set[] = $column.' = '.$placeholder; |
|
422 | 422 | $types[] = $this->columnTypes[$columnName]; |
423 | 423 | } |
424 | 424 | |
@@ -466,18 +466,18 @@ discard block |
||
466 | 466 | case Type::SMALLINT: |
467 | 467 | case Type::INTEGER: |
468 | 468 | case Type::BIGINT: |
469 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
469 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
470 | 470 | break; |
471 | 471 | |
472 | 472 | case Type::DATETIME: |
473 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
473 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
474 | 474 | break; |
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | - $sql = 'UPDATE ' . $quotedTableName |
|
479 | - . ' SET ' . implode(', ', $set) |
|
480 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
478 | + $sql = 'UPDATE '.$quotedTableName |
|
479 | + . ' SET '.implode(', ', $set) |
|
480 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
481 | 481 | |
482 | 482 | $result = $this->conn->executeUpdate($sql, $params, $types); |
483 | 483 | |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | |
522 | 522 | if ($selfReferential) { |
523 | - $otherColumns = (! $mapping['isOwningSide']) |
|
523 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
524 | 524 | ? $association['joinTable']['joinColumns'] |
525 | 525 | : $association['joinTable']['inverseJoinColumns']; |
526 | 526 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $tableName = $this->quoteStrategy->getTableName($class, $this->platform); |
559 | 559 | $idColumns = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform); |
560 | 560 | $id = array_combine($idColumns, $identifier); |
561 | - $types = array_map(function ($identifier) use ($class, $self) { |
|
561 | + $types = array_map(function($identifier) use ($class, $self) { |
|
562 | 562 | if (isset($class->fieldMappings[$identifier])) { |
563 | 563 | return $class->fieldMappings[$identifier]['type']; |
564 | 564 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | ); |
1022 | 1022 | } |
1023 | 1023 | |
1024 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1024 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1025 | 1025 | $parameters[] = [ |
1026 | 1026 | 'value' => $value, |
1027 | 1027 | 'field' => $field, |
@@ -1064,11 +1064,11 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | switch ($lockMode) { |
1066 | 1066 | case LockMode::PESSIMISTIC_READ: |
1067 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1067 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1068 | 1068 | break; |
1069 | 1069 | |
1070 | 1070 | case LockMode::PESSIMISTIC_WRITE: |
1071 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1071 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1072 | 1072 | break; |
1073 | 1073 | } |
1074 | 1074 | |
@@ -1079,14 +1079,14 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | if ('' !== $filterSql) { |
1081 | 1081 | $conditionSql = $conditionSql |
1082 | - ? $conditionSql . ' AND ' . $filterSql |
|
1082 | + ? $conditionSql.' AND '.$filterSql |
|
1083 | 1083 | : $filterSql; |
1084 | 1084 | } |
1085 | 1085 | |
1086 | - $select = 'SELECT ' . $columnList; |
|
1087 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1088 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1089 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1086 | + $select = 'SELECT '.$columnList; |
|
1087 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1088 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1089 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1090 | 1090 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1091 | 1091 | $query = $select |
1092 | 1092 | . $lock |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | . $where |
1095 | 1095 | . $orderBySql; |
1096 | 1096 | |
1097 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1097 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | /** |
@@ -1113,13 +1113,13 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | if ('' !== $filterSql) { |
1115 | 1115 | $conditionSql = $conditionSql |
1116 | - ? $conditionSql . ' AND ' . $filterSql |
|
1116 | + ? $conditionSql.' AND '.$filterSql |
|
1117 | 1117 | : $filterSql; |
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | $sql = 'SELECT COUNT(*) ' |
1121 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1122 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1121 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1122 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1123 | 1123 | |
1124 | 1124 | return $sql; |
1125 | 1125 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | : $baseTableAlias; |
1153 | 1153 | |
1154 | 1154 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1155 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1155 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1156 | 1156 | |
1157 | 1157 | continue; |
1158 | 1158 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | |
1170 | 1170 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1171 | 1171 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1172 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1172 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | continue; |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | throw ORMException::unrecognizedField($fieldName); |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1181 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1206,8 +1206,8 @@ discard block |
||
1206 | 1206 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1207 | 1207 | } |
1208 | 1208 | |
1209 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | - $eagerAliasCounter = 0; |
|
1209 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | + $eagerAliasCounter = 0; |
|
1211 | 1211 | |
1212 | 1212 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1213 | 1213 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | continue; // now this is why you shouldn't use inheritance |
1234 | 1234 | } |
1235 | 1235 | |
1236 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1236 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1237 | 1237 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1238 | 1238 | |
1239 | 1239 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1266,14 +1266,14 @@ discard block |
||
1266 | 1266 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1267 | 1267 | |
1268 | 1268 | if ($assoc['isOwningSide']) { |
1269 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1269 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1271 | 1271 | |
1272 | 1272 | foreach ($association['joinColumns'] as $joinColumn) { |
1273 | 1273 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1274 | 1274 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1275 | 1275 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1276 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1276 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1277 | 1277 | } |
1278 | 1278 | |
1279 | 1279 | // Add filter SQL |
@@ -1289,12 +1289,12 @@ discard block |
||
1289 | 1289 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1290 | 1290 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1291 | 1291 | |
1292 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1293 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1292 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1293 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1294 | 1294 | } |
1295 | 1295 | } |
1296 | 1296 | |
1297 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1297 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1298 | 1298 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1299 | 1299 | } |
1300 | 1300 | |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | */ |
1316 | 1316 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1317 | 1317 | { |
1318 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1318 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1319 | 1319 | return ''; |
1320 | 1320 | } |
1321 | 1321 | |
@@ -1364,10 +1364,10 @@ discard block |
||
1364 | 1364 | foreach ($joinColumns as $joinColumn) { |
1365 | 1365 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1366 | 1366 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1367 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1367 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1368 | 1368 | } |
1369 | 1369 | |
1370 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1370 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | 1373 | /** |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | continue; |
1447 | 1447 | } |
1448 | 1448 | |
1449 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1449 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1450 | 1450 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1451 | 1451 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1452 | 1452 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | */ |
1468 | 1468 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1469 | 1469 | { |
1470 | - $root = $alias == 'r' ? '' : $alias ; |
|
1470 | + $root = $alias == 'r' ? '' : $alias; |
|
1471 | 1471 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1472 | 1472 | $fieldMapping = $class->fieldMappings[$field]; |
1473 | 1473 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1480,7 +1480,7 @@ discard block |
||
1480 | 1480 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - return $sql . ' AS ' . $columnAlias; |
|
1483 | + return $sql.' AS '.$columnAlias; |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | /** |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | protected function getSQLTableAlias($className, $assocName = '') |
1497 | 1497 | { |
1498 | 1498 | if ($assocName) { |
1499 | - $className .= '#' . $assocName; |
|
1499 | + $className .= '#'.$assocName; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1503 | 1503 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1504 | 1504 | } |
1505 | 1505 | |
1506 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1506 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1507 | 1507 | |
1508 | 1508 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1509 | 1509 | |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | $lock = $this->getLockTablesSql($lockMode); |
1533 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1533 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1534 | 1534 | $sql = 'SELECT 1 ' |
1535 | 1535 | . $lock |
1536 | 1536 | . $where |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | { |
1553 | 1553 | return $this->platform->appendLockHint( |
1554 | 1554 | 'FROM ' |
1555 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1555 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1556 | 1556 | . $this->getSQLTableAlias($this->class->name), |
1557 | 1557 | $lockMode |
1558 | 1558 | ); |
@@ -1604,19 +1604,19 @@ discard block |
||
1604 | 1604 | |
1605 | 1605 | if (null !== $comparison) { |
1606 | 1606 | // special case null value handling |
1607 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1608 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1607 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1608 | + $selectedColumns[] = $column.' IS NULL'; |
|
1609 | 1609 | |
1610 | 1610 | continue; |
1611 | 1611 | } |
1612 | 1612 | |
1613 | 1613 | if ($comparison === Comparison::NEQ && null === $value) { |
1614 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1614 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1615 | 1615 | |
1616 | 1616 | continue; |
1617 | 1617 | } |
1618 | 1618 | |
1619 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1619 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1620 | 1620 | |
1621 | 1621 | continue; |
1622 | 1622 | } |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | ? $this->class->fieldMappings[$field]['inherited'] |
1665 | 1665 | : $this->class->name; |
1666 | 1666 | |
1667 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1667 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1668 | 1668 | } |
1669 | 1669 | |
1670 | 1670 | if (isset($this->class->associationMappings[$field])) { |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | |
1686 | 1686 | |
1687 | 1687 | foreach ($joinColumns as $joinColumn) { |
1688 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1688 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | } else { |
@@ -1693,12 +1693,12 @@ discard block |
||
1693 | 1693 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1694 | 1694 | } |
1695 | 1695 | |
1696 | - $className = (isset($association['inherited'])) |
|
1696 | + $className = (isset($association['inherited'])) |
|
1697 | 1697 | ? $association['inherited'] |
1698 | 1698 | : $this->class->name; |
1699 | 1699 | |
1700 | 1700 | foreach ($association['joinColumns'] as $joinColumn) { |
1701 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1701 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1702 | 1702 | } |
1703 | 1703 | } |
1704 | 1704 | return $columns; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1791 | 1791 | } |
1792 | 1792 | |
1793 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1793 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1794 | 1794 | $parameters[] = [ |
1795 | 1795 | 'value' => $value, |
1796 | 1796 | 'field' => $field, |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1804 | 1804 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1805 | 1805 | |
1806 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1806 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1807 | 1807 | $parameters[] = [ |
1808 | 1808 | 'value' => $value, |
1809 | 1809 | 'field' => $field, |
@@ -1891,7 +1891,7 @@ discard block |
||
1891 | 1891 | $assoc = $class->associationMappings[$field]; |
1892 | 1892 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1893 | 1893 | |
1894 | - if (! $assoc['isOwningSide']) { |
|
1894 | + if ( ! $assoc['isOwningSide']) { |
|
1895 | 1895 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1896 | 1896 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1897 | 1897 | } |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | ? $assoc['relationToTargetKeyColumns'] |
1901 | 1901 | : $assoc['sourceToTargetKeyColumns']; |
1902 | 1902 | |
1903 | - foreach ($columns as $column){ |
|
1903 | + foreach ($columns as $column) { |
|
1904 | 1904 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1905 | 1905 | } |
1906 | 1906 | break; |
@@ -1911,7 +1911,7 @@ discard block |
||
1911 | 1911 | } |
1912 | 1912 | |
1913 | 1913 | if (is_array($value)) { |
1914 | - return array_map(function ($type) { |
|
1914 | + return array_map(function($type) { |
|
1915 | 1915 | $type = Type::getType($type); |
1916 | 1916 | |
1917 | 1917 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -1987,12 +1987,12 @@ discard block |
||
1987 | 1987 | |
1988 | 1988 | $sql = 'SELECT 1 ' |
1989 | 1989 | . $this->getLockTablesSql(null) |
1990 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1990 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
1991 | 1991 | |
1992 | 1992 | list($params, $types) = $this->expandParameters($criteria); |
1993 | 1993 | |
1994 | 1994 | if (null !== $extraConditions) { |
1995 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
1995 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
1996 | 1996 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
1997 | 1997 | |
1998 | 1998 | $params = array_merge($params, $criteriaParams); |
@@ -2000,7 +2000,7 @@ discard block |
||
2000 | 2000 | } |
2001 | 2001 | |
2002 | 2002 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2003 | - $sql .= ' AND ' . $filterSql; |
|
2003 | + $sql .= ' AND '.$filterSql; |
|
2004 | 2004 | } |
2005 | 2005 | |
2006 | 2006 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2047,13 +2047,13 @@ discard block |
||
2047 | 2047 | |
2048 | 2048 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2049 | 2049 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2050 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2050 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2051 | 2051 | } |
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | $sql = implode(' AND ', $filterClauses); |
2055 | 2055 | |
2056 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2056 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | /** |
@@ -47,17 +47,17 @@ |
||
47 | 47 | * Get all queued inserts. |
48 | 48 | * |
49 | 49 | * @return array |
50 | - */ |
|
50 | + */ |
|
51 | 51 | public function getInserts(); |
52 | 52 | |
53 | - /** |
|
54 | - * @TODO - It should not be here. |
|
55 | - * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister. |
|
56 | - * |
|
57 | - * Gets the INSERT SQL used by the persister to persist a new entity. |
|
58 | - * |
|
59 | - * @return string |
|
60 | - */ |
|
53 | + /** |
|
54 | + * @TODO - It should not be here. |
|
55 | + * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister. |
|
56 | + * |
|
57 | + * Gets the INSERT SQL used by the persister to persist a new entity. |
|
58 | + * |
|
59 | + * @return string |
|
60 | + */ |
|
61 | 61 | public function getInsertSQL(); |
62 | 62 | |
63 | 63 | /** |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $rootClass = $this->em->getClassMetadata($this->class->rootEntityName); |
58 | 58 | $tableAlias = $this->getSQLTableAlias($rootClass->name); |
59 | 59 | |
60 | - // Append discriminator column |
|
60 | + // Append discriminator column |
|
61 | 61 | $discrColumn = $this->class->discriminatorColumn['name']; |
62 | 62 | $discrColumnType = $this->class->discriminatorColumn['type']; |
63 | 63 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $discrColumn = $this->class->discriminatorColumn['name']; |
62 | 62 | $discrColumnType = $this->class->discriminatorColumn['type']; |
63 | 63 | |
64 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
64 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
65 | 65 | |
66 | 66 | $resultColumnName = $this->platform->getSQLResultCasing($discrColumn); |
67 | 67 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $conditionSql .= ' AND '; |
143 | 143 | } |
144 | 144 | |
145 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
145 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $conditionSql .= ' AND '; |
157 | 157 | } |
158 | 158 | |
159 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
159 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $discColumn = $this->class->discriminatorColumn['name']; |
181 | 181 | $tableAlias = $this->getSQLTableAlias($this->class->name); |
182 | 182 | |
183 | - return $tableAlias . '.' . $discColumn . ' IN (' . $values . ')'; |
|
183 | + return $tableAlias.'.'.$discColumn.' IN ('.$values.')'; |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public static function noDispatchForNode($node) |
35 | 35 | { |
36 | - return new self("Double-dispatch for node " . get_class($node) . " is not supported."); |
|
36 | + return new self("Double-dispatch for node ".get_class($node)." is not supported."); |
|
37 | 37 | } |
38 | 38 | } |