@@ -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'; |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
347 | 347 | |
348 | 348 | // FIXME: Order with composite keys might not be correct |
349 | - $sql = 'SELECT ' . $columnName |
|
350 | - . ' FROM ' . $tableName |
|
351 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
349 | + $sql = 'SELECT '.$columnName |
|
350 | + . ' FROM '.$tableName |
|
351 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
352 | 352 | |
353 | 353 | |
354 | 354 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | |
443 | 443 | $params[] = $value; |
444 | - $set[] = $column . ' = ' . $placeholder; |
|
444 | + $set[] = $column.' = '.$placeholder; |
|
445 | 445 | $types[] = $this->columnTypes[$columnName]; |
446 | 446 | } |
447 | 447 | |
@@ -487,18 +487,18 @@ discard block |
||
487 | 487 | case Type::SMALLINT: |
488 | 488 | case Type::INTEGER: |
489 | 489 | case Type::BIGINT: |
490 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
490 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
491 | 491 | break; |
492 | 492 | |
493 | 493 | case Type::DATETIME: |
494 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
494 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
495 | 495 | break; |
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
499 | - $sql = 'UPDATE ' . $quotedTableName |
|
500 | - . ' SET ' . implode(', ', $set) |
|
501 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
499 | + $sql = 'UPDATE '.$quotedTableName |
|
500 | + . ' SET '.implode(', ', $set) |
|
501 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
502 | 502 | |
503 | 503 | $result = $this->conn->executeUpdate($sql, $params, $types); |
504 | 504 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | |
543 | 543 | if ($selfReferential) { |
544 | - $otherColumns = (! $mapping['isOwningSide']) |
|
544 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
545 | 545 | ? $association['joinTable']['joinColumns'] |
546 | 546 | : $association['joinTable']['inverseJoinColumns']; |
547 | 547 | } |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | } |
691 | 691 | $oid = spl_object_hash($newVal); |
692 | 692 | $uow = $this->em->getUnitOfWork(); |
693 | - if (!(isset($this->queuedInserts[$oid]) || $uow->isScheduledForInsert($newVal))) { |
|
693 | + if ( ! (isset($this->queuedInserts[$oid]) || $uow->isScheduledForInsert($newVal))) { |
|
694 | 694 | return false; |
695 | 695 | } |
696 | 696 | if ($newVal !== $entity) { |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | ); |
1047 | 1047 | } |
1048 | 1048 | |
1049 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1049 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1050 | 1050 | $parameters[] = [ |
1051 | 1051 | 'value' => $value, |
1052 | 1052 | 'field' => $field, |
@@ -1089,11 +1089,11 @@ discard block |
||
1089 | 1089 | |
1090 | 1090 | switch ($lockMode) { |
1091 | 1091 | case LockMode::PESSIMISTIC_READ: |
1092 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1092 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1093 | 1093 | break; |
1094 | 1094 | |
1095 | 1095 | case LockMode::PESSIMISTIC_WRITE: |
1096 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1096 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1097 | 1097 | break; |
1098 | 1098 | } |
1099 | 1099 | |
@@ -1104,14 +1104,14 @@ discard block |
||
1104 | 1104 | |
1105 | 1105 | if ('' !== $filterSql) { |
1106 | 1106 | $conditionSql = $conditionSql |
1107 | - ? $conditionSql . ' AND ' . $filterSql |
|
1107 | + ? $conditionSql.' AND '.$filterSql |
|
1108 | 1108 | : $filterSql; |
1109 | 1109 | } |
1110 | 1110 | |
1111 | - $select = 'SELECT ' . $columnList; |
|
1112 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1113 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1114 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1111 | + $select = 'SELECT '.$columnList; |
|
1112 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1113 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1114 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1115 | 1115 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1116 | 1116 | $query = $select |
1117 | 1117 | . $lock |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | . $where |
1120 | 1120 | . $orderBySql; |
1121 | 1121 | |
1122 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1122 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | /** |
@@ -1138,13 +1138,13 @@ discard block |
||
1138 | 1138 | |
1139 | 1139 | if ('' !== $filterSql) { |
1140 | 1140 | $conditionSql = $conditionSql |
1141 | - ? $conditionSql . ' AND ' . $filterSql |
|
1141 | + ? $conditionSql.' AND '.$filterSql |
|
1142 | 1142 | : $filterSql; |
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $sql = 'SELECT COUNT(*) ' |
1146 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1147 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1146 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1147 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1148 | 1148 | |
1149 | 1149 | return $sql; |
1150 | 1150 | } |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | : $baseTableAlias; |
1178 | 1178 | |
1179 | 1179 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1180 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1180 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1181 | 1181 | |
1182 | 1182 | continue; |
1183 | 1183 | } |
@@ -1194,7 +1194,7 @@ discard block |
||
1194 | 1194 | |
1195 | 1195 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1196 | 1196 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1197 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1197 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1198 | 1198 | } |
1199 | 1199 | |
1200 | 1200 | continue; |
@@ -1203,7 +1203,7 @@ discard block |
||
1203 | 1203 | throw ORMException::unrecognizedField($fieldName); |
1204 | 1204 | } |
1205 | 1205 | |
1206 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1206 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1207 | 1207 | } |
1208 | 1208 | |
1209 | 1209 | /** |
@@ -1231,8 +1231,8 @@ discard block |
||
1231 | 1231 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1232 | 1232 | } |
1233 | 1233 | |
1234 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1235 | - $eagerAliasCounter = 0; |
|
1234 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1235 | + $eagerAliasCounter = 0; |
|
1236 | 1236 | |
1237 | 1237 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1238 | 1238 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | continue; // now this is why you shouldn't use inheritance |
1259 | 1259 | } |
1260 | 1260 | |
1261 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1261 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1262 | 1262 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1263 | 1263 | |
1264 | 1264 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1291,14 +1291,14 @@ discard block |
||
1291 | 1291 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1292 | 1292 | |
1293 | 1293 | if ($assoc['isOwningSide']) { |
1294 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1295 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1294 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1295 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1296 | 1296 | |
1297 | 1297 | foreach ($association['joinColumns'] as $joinColumn) { |
1298 | 1298 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1299 | 1299 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1300 | 1300 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1301 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1301 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1302 | 1302 | } |
1303 | 1303 | |
1304 | 1304 | // Add filter SQL |
@@ -1314,12 +1314,12 @@ discard block |
||
1314 | 1314 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1315 | 1315 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1316 | 1316 | |
1317 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1318 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1317 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1318 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1319 | 1319 | } |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1322 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1323 | 1323 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1324 | 1324 | } |
1325 | 1325 | |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | */ |
1341 | 1341 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1342 | 1342 | { |
1343 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1343 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1344 | 1344 | return ''; |
1345 | 1345 | } |
1346 | 1346 | |
@@ -1389,10 +1389,10 @@ discard block |
||
1389 | 1389 | foreach ($joinColumns as $joinColumn) { |
1390 | 1390 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1391 | 1391 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1392 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1392 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1393 | 1393 | } |
1394 | 1394 | |
1395 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1395 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1396 | 1396 | } |
1397 | 1397 | |
1398 | 1398 | /** |
@@ -1471,7 +1471,7 @@ discard block |
||
1471 | 1471 | continue; |
1472 | 1472 | } |
1473 | 1473 | |
1474 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1474 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1475 | 1475 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1476 | 1476 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1477 | 1477 | } |
@@ -1492,7 +1492,7 @@ discard block |
||
1492 | 1492 | */ |
1493 | 1493 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1494 | 1494 | { |
1495 | - $root = $alias == 'r' ? '' : $alias ; |
|
1495 | + $root = $alias == 'r' ? '' : $alias; |
|
1496 | 1496 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1497 | 1497 | $fieldMapping = $class->fieldMappings[$field]; |
1498 | 1498 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1506 | 1506 | } |
1507 | 1507 | |
1508 | - return $sql . ' AS ' . $columnAlias; |
|
1508 | + return $sql.' AS '.$columnAlias; |
|
1509 | 1509 | } |
1510 | 1510 | |
1511 | 1511 | /** |
@@ -1521,14 +1521,14 @@ discard block |
||
1521 | 1521 | protected function getSQLTableAlias($className, $assocName = '') |
1522 | 1522 | { |
1523 | 1523 | if ($assocName) { |
1524 | - $className .= '#' . $assocName; |
|
1524 | + $className .= '#'.$assocName; |
|
1525 | 1525 | } |
1526 | 1526 | |
1527 | 1527 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1528 | 1528 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1529 | 1529 | } |
1530 | 1530 | |
1531 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1531 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1532 | 1532 | |
1533 | 1533 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1534 | 1534 | |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | } |
1556 | 1556 | |
1557 | 1557 | $lock = $this->getLockTablesSql($lockMode); |
1558 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1558 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1559 | 1559 | $sql = 'SELECT 1 ' |
1560 | 1560 | . $lock |
1561 | 1561 | . $where |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | { |
1578 | 1578 | return $this->platform->appendLockHint( |
1579 | 1579 | 'FROM ' |
1580 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1580 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1581 | 1581 | . $this->getSQLTableAlias($this->class->name), |
1582 | 1582 | $lockMode |
1583 | 1583 | ); |
@@ -1629,19 +1629,19 @@ discard block |
||
1629 | 1629 | |
1630 | 1630 | if (null !== $comparison) { |
1631 | 1631 | // special case null value handling |
1632 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1633 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1632 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1633 | + $selectedColumns[] = $column.' IS NULL'; |
|
1634 | 1634 | |
1635 | 1635 | continue; |
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | if ($comparison === Comparison::NEQ && null === $value) { |
1639 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1639 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1640 | 1640 | |
1641 | 1641 | continue; |
1642 | 1642 | } |
1643 | 1643 | |
1644 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1644 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1645 | 1645 | |
1646 | 1646 | continue; |
1647 | 1647 | } |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | ? $this->class->fieldMappings[$field]['inherited'] |
1690 | 1690 | : $this->class->name; |
1691 | 1691 | |
1692 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1692 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1693 | 1693 | } |
1694 | 1694 | |
1695 | 1695 | if (isset($this->class->associationMappings[$field])) { |
@@ -1710,7 +1710,7 @@ discard block |
||
1710 | 1710 | |
1711 | 1711 | |
1712 | 1712 | foreach ($joinColumns as $joinColumn) { |
1713 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1713 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1714 | 1714 | } |
1715 | 1715 | |
1716 | 1716 | } else { |
@@ -1718,12 +1718,12 @@ discard block |
||
1718 | 1718 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1719 | 1719 | } |
1720 | 1720 | |
1721 | - $className = (isset($association['inherited'])) |
|
1721 | + $className = (isset($association['inherited'])) |
|
1722 | 1722 | ? $association['inherited'] |
1723 | 1723 | : $this->class->name; |
1724 | 1724 | |
1725 | 1725 | foreach ($association['joinColumns'] as $joinColumn) { |
1726 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1726 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1727 | 1727 | } |
1728 | 1728 | } |
1729 | 1729 | return $columns; |
@@ -1815,7 +1815,7 @@ discard block |
||
1815 | 1815 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1816 | 1816 | } |
1817 | 1817 | |
1818 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1818 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1819 | 1819 | $parameters[] = [ |
1820 | 1820 | 'value' => $value, |
1821 | 1821 | 'field' => $field, |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1829 | 1829 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1830 | 1830 | |
1831 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1831 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1832 | 1832 | $parameters[] = [ |
1833 | 1833 | 'value' => $value, |
1834 | 1834 | 'field' => $field, |
@@ -1916,7 +1916,7 @@ discard block |
||
1916 | 1916 | $assoc = $class->associationMappings[$field]; |
1917 | 1917 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1918 | 1918 | |
1919 | - if (! $assoc['isOwningSide']) { |
|
1919 | + if ( ! $assoc['isOwningSide']) { |
|
1920 | 1920 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1921 | 1921 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1922 | 1922 | } |
@@ -1925,7 +1925,7 @@ discard block |
||
1925 | 1925 | ? $assoc['relationToTargetKeyColumns'] |
1926 | 1926 | : $assoc['sourceToTargetKeyColumns']; |
1927 | 1927 | |
1928 | - foreach ($columns as $column){ |
|
1928 | + foreach ($columns as $column) { |
|
1929 | 1929 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1930 | 1930 | } |
1931 | 1931 | break; |
@@ -1936,7 +1936,7 @@ discard block |
||
1936 | 1936 | } |
1937 | 1937 | |
1938 | 1938 | if (is_array($value)) { |
1939 | - return array_map(function ($type) { |
|
1939 | + return array_map(function($type) { |
|
1940 | 1940 | $type = Type::getType($type); |
1941 | 1941 | |
1942 | 1942 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -2012,12 +2012,12 @@ discard block |
||
2012 | 2012 | |
2013 | 2013 | $sql = 'SELECT 1 ' |
2014 | 2014 | . $this->getLockTablesSql(null) |
2015 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2015 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2016 | 2016 | |
2017 | 2017 | list($params, $types) = $this->expandParameters($criteria); |
2018 | 2018 | |
2019 | 2019 | if (null !== $extraConditions) { |
2020 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2020 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2021 | 2021 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2022 | 2022 | |
2023 | 2023 | $params = array_merge($params, $criteriaParams); |
@@ -2025,7 +2025,7 @@ discard block |
||
2025 | 2025 | } |
2026 | 2026 | |
2027 | 2027 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2028 | - $sql .= ' AND ' . $filterSql; |
|
2028 | + $sql .= ' AND '.$filterSql; |
|
2029 | 2029 | } |
2030 | 2030 | |
2031 | 2031 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2072,13 +2072,13 @@ discard block |
||
2072 | 2072 | |
2073 | 2073 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2074 | 2074 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2075 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2075 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2076 | 2076 | } |
2077 | 2077 | } |
2078 | 2078 | |
2079 | 2079 | $sql = implode(' AND ', $filterClauses); |
2080 | 2080 | |
2081 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2081 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2082 | 2082 | } |
2083 | 2083 | |
2084 | 2084 | /** |
@@ -2108,7 +2108,7 @@ discard block |
||
2108 | 2108 | $entityManager = $this->em; |
2109 | 2109 | |
2110 | 2110 | return array_map( |
2111 | - static function ($fieldName) use ($class, $entityManager) : string { |
|
2111 | + static function($fieldName) use ($class, $entityManager) : string { |
|
2112 | 2112 | $types = PersisterHelper::getTypeOfField($fieldName, $class, $entityManager); |
2113 | 2113 | assert(isset($types[0])); |
2114 | 2114 |
@@ -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 | } |