Fake commit

This commit is contained in:
José Lorenzo Rodríguez 2009-11-16 22:22:20 -04:30
parent 2503632327
commit 285329e7a4

View file

@ -1350,7 +1350,7 @@ class DboSource extends DataSource {
* @return string An executable SQL statement * @return string An executable SQL statement
* @see DboSource::renderStatement() * @see DboSource::renderStatement()
*/ */
function buildStatement($query, $model) { function buildStatement($query, &$model) {
$query = array_merge(array('offset' => null, 'joins' => array()), $query); $query = array_merge(array('offset' => null, 'joins' => array()), $query);
if (!empty($query['joins'])) { if (!empty($query['joins'])) {
$count = count($query['joins']); $count = count($query['joins']);
@ -1365,7 +1365,7 @@ class DboSource extends DataSource {
'fields' => implode(', ', $query['fields']), 'fields' => implode(', ', $query['fields']),
'table' => $query['table'], 'table' => $query['table'],
'alias' => $this->alias . $this->name($query['alias']), 'alias' => $this->alias . $this->name($query['alias']),
'order' => $this->order($query['order']), 'order' => $this->order($query['order'],'ASC',$model),
'limit' => $this->limit($query['limit'], $query['offset']), 'limit' => $this->limit($query['limit'], $query['offset']),
'joins' => implode(' ', $query['joins']), 'joins' => implode(' ', $query['joins']),
'group' => $this->group($query['group']) 'group' => $this->group($query['group'])
@ -2177,7 +2177,7 @@ class DboSource extends DataSource {
* @param string $direction Direction (ASC or DESC) * @param string $direction Direction (ASC or DESC)
* @return string ORDER BY clause * @return string ORDER BY clause
*/ */
function order($keys, $direction = 'ASC') { function order($keys, $direction = 'ASC', &$model = null) {
if (is_string($keys) && strpos($keys, ',') && !preg_match('/\(.+\,.+\)/', $keys)) { if (is_string($keys) && strpos($keys, ',') && !preg_match('/\(.+\,.+\)/', $keys)) {
$keys = array_map('trim', explode(',', $keys)); $keys = array_map('trim', explode(',', $keys));
} }