Author: Derick Rethans
Date: 2007-05-04 14:32:35 +0200 (Fri, 04 May 2007)
New Revision: 5045
Log:
- Fixed CS
Modified:
trunk/Database/src/handlers/mssql.php
trunk/Database/src/sqlabstraction/expression.php
trunk/Database/src/sqlabstraction/implementations/expression_oracle.php
trunk/Database/src/sqlabstraction/implementations/expression_pgsql.php
trunk/Database/src/sqlabstraction/implementations/expression_sqlite.php
trunk/Database/src/sqlabstraction/implementations/query_select_mssql.php
trunk/Database/src/sqlabstraction/implementations/query_select_oracle.php
Modified: trunk/Database/src/handlers/mssql.php
===================================================================
--- trunk/Database/src/handlers/mssql.php 2007-05-04 12:26:26 UTC (rev
5044)
+++ trunk/Database/src/handlers/mssql.php 2007-05-04 12:32:35 UTC (rev
5045)
@@ -124,7 +124,7 @@
$retval = true;
if ( $this->transactionNestingLevel == 0 )
{
- $retval = $this->exec("BEGIN TRANSACTION");
+ $retval = $this->exec( "BEGIN TRANSACTION" );
}
// else NOP
@@ -161,13 +161,13 @@
{
if ( $this->transactionErrorFlag )
{
- $this->exec("ROLLBACK TRANSACTION");
+ $this->exec( "ROLLBACK TRANSACTION" );
$this->transactionErrorFlag = false; // reset error flag
$retval = false;
}
else
{
- $this->exec("COMMIT TRANSACTION");
+ $this->exec( "COMMIT TRANSACTION" );
}
}
// else NOP
@@ -200,7 +200,7 @@
if ( $this->transactionNestingLevel == 1 )
{
- $this->exec("ROLLBACK TRANSACTION");
+ $this->exec( "ROLLBACK TRANSACTION" );
$this->transactionErrorFlag = false; // reset error flag
}
else
Modified: trunk/Database/src/sqlabstraction/expression.php
===================================================================
--- trunk/Database/src/sqlabstraction/expression.php 2007-05-04 12:26:26 UTC
(rev 5044)
+++ trunk/Database/src/sqlabstraction/expression.php 2007-05-04 12:32:35 UTC
(rev 5045)
@@ -1018,15 +1018,15 @@
}
$expr = ' CASE';
- foreach( $args as $arg )
+ foreach ( $args as $arg )
{
- if( is_array( $arg ) && count( $arg ) == 2 )
+ if ( is_array( $arg ) && count( $arg ) == 2 )
{
$column1 = $this->getIdentifier( $arg[0] );
$column2 = $this->getIdentifier( $arg[1] );
$expr .= " WHEN {$column1} THEN {$column2}";
}
- else if( is_scalar( $arg ) )
+ else if ( is_scalar( $arg ) )
{
$column = $this->getIdentifier( $arg );
$expr .= " ELSE {$column}";
Modified:
trunk/Database/src/sqlabstraction/implementations/expression_oracle.php
===================================================================
--- trunk/Database/src/sqlabstraction/implementations/expression_oracle.php
2007-05-04 12:26:26 UTC (rev 5044)
+++ trunk/Database/src/sqlabstraction/implementations/expression_oracle.php
2007-05-04 12:32:35 UTC (rev 5045)
@@ -152,11 +152,11 @@
{
$column = $this->getIdentifier( $column );
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
// // alternative
-// if( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2}
[0-9]{2}:[0-9]{2}:[0-9]{2}/', $column ) ) {
+// if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2}
[0-9]{2}:[0-9]{2}:[0-9]{2}/', $column ) ) {
// $column = "TO_TIMESTAMP( {$column}, 'YYYY-MM-DD HH24:MI:SS'
)";
// }
}
@@ -179,7 +179,7 @@
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
@@ -200,7 +200,7 @@
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
@@ -220,12 +220,12 @@
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
- if( $type == 'SECOND' )
+ if ( $type == 'SECOND' )
{
return " FLOOR( EXTRACT( {$type} FROM {$column} ) ) ";
}
Modified: trunk/Database/src/sqlabstraction/implementations/expression_pgsql.php
===================================================================
--- trunk/Database/src/sqlabstraction/implementations/expression_pgsql.php
2007-05-04 12:26:26 UTC (rev 5044)
+++ trunk/Database/src/sqlabstraction/implementations/expression_pgsql.php
2007-05-04 12:32:35 UTC (rev 5045)
@@ -176,7 +176,7 @@
{
$type = $this->intervalMap[$type];
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = $this->getIdentifier( $column );
$column = "CAST( {$column} AS TIMESTAMP )";
@@ -197,7 +197,7 @@
{
$type = $this->intervalMap[$type];
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = $this->getIdentifier( $column );
$column = "CAST( {$column} AS TIMESTAMP )";
@@ -217,7 +217,7 @@
{
$type = $this->intervalMap[$type];
- if( $column != 'NOW()' )
+ if ( $column != 'NOW()' )
{
$column = $this->getIdentifier( $column );
$column = "CAST( {$column} AS TIMESTAMP )";
Modified:
trunk/Database/src/sqlabstraction/implementations/expression_sqlite.php
===================================================================
--- trunk/Database/src/sqlabstraction/implementations/expression_sqlite.php
2007-05-04 12:26:26 UTC (rev 5044)
+++ trunk/Database/src/sqlabstraction/implementations/expression_sqlite.php
2007-05-04 12:32:35 UTC (rev 5045)
@@ -92,7 +92,7 @@
*/
public function unixTimestamp( $column )
{
- if( $column == 'NOW()' )
+ if ( $column == 'NOW()' )
{
return " strftime( '%s', 'now' ) ";
}
@@ -166,7 +166,7 @@
break;
}
- if( $column == 'NOW()' )
+ if ( $column == 'NOW()' )
{
$column = "'now'";
}
Modified:
trunk/Database/src/sqlabstraction/implementations/query_select_mssql.php
===================================================================
--- trunk/Database/src/sqlabstraction/implementations/query_select_mssql.php
2007-05-04 12:26:26 UTC (rev 5044)
+++ trunk/Database/src/sqlabstraction/implementations/query_select_mssql.php
2007-05-04 12:32:35 UTC (rev 5045)
@@ -73,7 +73,8 @@
*/
public function orderBy( $column, $type = self::ASC )
{
- if($this->invertedOrderString) {
+ if ( $this->invertedOrderString )
+ {
$this->invertedOrderString .= ', ';
}
else
@@ -81,7 +82,7 @@
$this->invertedOrderString = 'ORDER BY ';
}
$this->invertedOrderString .= $column . ' ' . ( $type == self::ASC ?
self::DESC : self::ASC );
- return parent::orderBy($column, $type);
+ return parent::orderBy( $column, $type );
}
/**
@@ -91,7 +92,8 @@
* @param string $query SQL select query
* @return string
*/
- static private function top($rowCount, $query) {
+ static private function top( $rowCount, $query )
+ {
return 'SELECT TOP ' . $rowCount . substr( $query, strlen( 'SELECT' )
);
}
@@ -109,11 +111,11 @@
$query = parent::getQuery();
if ( $this->hasLimit )
{
- if( $this->offset)
+ if ( $this->offset)
{
- if(!$this->orderString)
+ if ( !$this->orderString )
{
- //Uh ow. We need some columns to sort in the oposite order
to make this work
+ // Uh ow. We need some columns to sort in the oposite
order to make this work
throw new ezcQueryInvalidException( "LIMIT workaround for
MS SQL", "orderBy() was not called before getQuery()." );
}
return 'SELECT * FROM ( SELECT TOP ' . $this->limit . ' * FROM
( ' . self::top( $this->offset + $this->limit, $query ) . ' ) AS ezcDummyTable1
' . $this->invertedOrderString . ' ) AS ezcDummyTable2 ' . $this->orderString;
Modified:
trunk/Database/src/sqlabstraction/implementations/query_select_oracle.php
===================================================================
--- trunk/Database/src/sqlabstraction/implementations/query_select_oracle.php
2007-05-04 12:26:26 UTC (rev 5044)
+++ trunk/Database/src/sqlabstraction/implementations/query_select_oracle.php
2007-05-04 12:32:35 UTC (rev 5045)
@@ -127,7 +127,7 @@
if ( $this->hasLimit )
{
$max = $this->offset + $this->limit;
- if ($this->offset > 0)
+ if ( $this->offset > 0 )
{
$min = $this->offset + 1;
$query = "SELECT * FROM (SELECT a.*, ROWNUM rn FROM ( {$query}
) a WHERE rownum <= {$max} ) WHERE rn >= {$min}";
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components