@@ -95,6 +95,6 @@ |
||
| 95 | 95 | */ |
| 96 | 96 | public function __toString() |
| 97 | 97 | { |
| 98 | - return $this->leftExpr . ' ' . $this->operator . ' ' . $this->rightExpr; |
|
| 98 | + return $this->leftExpr.' '.$this->operator.' '.$this->rightExpr; |
|
| 99 | 99 | } |
| 100 | 100 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @var string |
| 35 | 35 | */ |
| 36 | - protected $preSeparator = ''; |
|
| 36 | + protected $preSeparator = ''; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var string |
@@ -92,16 +92,16 @@ |
||
| 92 | 92 | $leftExpr = (string) $this->leftExpr; |
| 93 | 93 | |
| 94 | 94 | if ($this->leftExpr instanceof Math) { |
| 95 | - $leftExpr = '(' . $leftExpr . ')'; |
|
| 95 | + $leftExpr = '('.$leftExpr.')'; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Adjusting Right Expression |
| 99 | 99 | $rightExpr = (string) $this->rightExpr; |
| 100 | 100 | |
| 101 | 101 | if ($this->rightExpr instanceof Math) { |
| 102 | - $rightExpr = '(' . $rightExpr . ')'; |
|
| 102 | + $rightExpr = '('.$rightExpr.')'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - return $leftExpr . ' ' . $this->operator . ' ' . $rightExpr; |
|
| 105 | + return $leftExpr.' '.$this->operator.' '.$rightExpr; |
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -58,12 +58,12 @@ |
||
| 58 | 58 | $queryPart = (string) $part; |
| 59 | 59 | |
| 60 | 60 | if (is_object($part) && $part instanceof self && $part->count() > 1) { |
| 61 | - return $this->preSeparator . $queryPart . $this->postSeparator; |
|
| 61 | + return $this->preSeparator.$queryPart.$this->postSeparator; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Fixes DDC-1237: User may have added a where item containing nested expression (with "OR" or "AND") |
| 65 | 65 | if (stripos($queryPart, ' OR ') !== false || stripos($queryPart, ' AND ') !== false) { |
| 66 | - return $this->preSeparator . $queryPart . $this->postSeparator; |
|
| 66 | + return $this->preSeparator.$queryPart.$this->postSeparator; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $queryPart; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function add($arg) |
| 88 | 88 | { |
| 89 | - if ( $arg !== null && (!$arg instanceof self || $arg->count() > 0) ) { |
|
| 89 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
| 90 | 90 | // If we decide to keep Expr\Base instances, we can use this check |
| 91 | 91 | if ( ! is_string($arg)) { |
| 92 | 92 | $class = get_class($arg); |
@@ -119,6 +119,6 @@ discard block |
||
| 119 | 119 | return (string) $this->parts[0]; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
| 122 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
| 123 | 123 | } |
| 124 | 124 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function add($sort, $order = null) |
| 76 | 76 | { |
| 77 | 77 | $order = ! $order ? 'ASC' : $order; |
| 78 | - $this->parts[] = $sort . ' '. $order; |
|
| 78 | + $this->parts[] = $sort.' '.$order; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -99,6 +99,6 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function __tostring() |
| 101 | 101 | { |
| 102 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
| 102 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
| 103 | 103 | } |
| 104 | 104 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | */ |
| 87 | 87 | public function __toString() |
| 88 | 88 | { |
| 89 | - return $this->from . ' ' . $this->alias . |
|
| 90 | - ($this->indexBy ? ' INDEX BY ' . $this->indexBy : ''); |
|
| 89 | + return $this->from.' '.$this->alias. |
|
| 90 | + ($this->indexBy ? ' INDEX BY '.$this->indexBy : ''); |
|
| 91 | 91 | } |
| 92 | 92 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 78 | 78 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
| 79 | 79 | |
| 80 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
| 81 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
| 80 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
| 81 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
| 82 | 82 | |
| 83 | 83 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
| 84 | 84 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
| 93 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
| 93 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
| 94 | 94 | |
| 95 | 95 | // 3. Create and store DELETE statements |
| 96 | 96 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
| 97 | 97 | foreach (array_reverse($classNames) as $className) { |
| 98 | 98 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
| 99 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
| 100 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
| 99 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
| 100 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // 4. Store DDL for temporary identifier table. |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | 'type' => Type::getType(PersisterHelper::getTypeOfColumn($idColumnName, $rootClass, $em)), |
| 109 | 109 | ); |
| 110 | 110 | } |
| 111 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 112 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 111 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 112 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 113 | 113 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
| 90 | 90 | |
| 91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
| 92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
| 91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
| 92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
| 93 | 93 | |
| 94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
| 95 | 95 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
| 98 | 98 | |
| 99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
| 100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
| 100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
| 101 | 101 | |
| 102 | 102 | // 3. Create and store UPDATE statements |
| 103 | 103 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | foreach (array_reverse($classNames) as $className) { |
| 107 | 107 | $affected = false; |
| 108 | 108 | $class = $em->getClassMetadata($className); |
| 109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
| 109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
| 110 | 110 | |
| 111 | 111 | foreach ($updateItems as $updateItem) { |
| 112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if ($affected) { |
| 136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
| 136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 157 | 157 | |
| 158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 159 | 159 | } |