Changeset 2487
- Timestamp:
- 08/05/2008 08:03:05 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
HISTORY (modified) (1 diff)
-
framework/Data/Common/TDbCommandBuilder.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r2486 r2487 1 1 Version 3.1.3 To Be Released 2 2 ============================ 3 BUG: Ticket#834 - TDbCommandBuilder::applyOrdering(): Add support for function calls in ORDER BY clause (Knut) 3 4 BUG: Ticket#836 - TRatingList downgrade (Christophe) 4 5 BUG: Ticket#841 - Strange output from THttpResponse (Christophe) -
trunk/framework/Data/Common/TDbCommandBuilder.php
r2482 r2487 106 106 { 107 107 $orders=array(); 108 foreach($ordering as $name =>$direction)108 foreach($ordering as $name => $direction) 109 109 { 110 110 $direction = strtolower($direction) == 'desc' ? 'DESC' : 'ASC'; 111 $column = $this->getTableInfo()->getColumn($name)->getColumnName(); 112 $orders[] = $column.' '.$direction; 111 if(strpos($name, '(') && strpos($name, ')')) { 112 // key is a function (bad practice, but we need to handle it) 113 $key = $name; 114 } else { 115 // key is a column 116 $key = $this->getTableInfo()->getColumn($name)->getColumnName(); 117 } 118 $orders[] = $key.' '.$direction; 113 119 } 114 120 if(count($orders) > 0)
