diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-11 02:47:11 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-11 02:47:11 +0000 |
commit | d4a597fd4bb2713b8f828211db6caa1b44c46faf (patch) | |
tree | 9def01bad8f51c27a002ae7d0d160777d0c9db4d /includes/database/pgsql | |
parent | f24f709e0f7d59643ca076fb00066e93fc81da01 (diff) | |
download | brdo-d4a597fd4bb2713b8f828211db6caa1b44c46faf.tar.gz brdo-d4a597fd4bb2713b8f828211db6caa1b44c46faf.tar.bz2 |
#561104 by Crell: Added support for random ordering in dynamic select queries.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r-- | includes/database/pgsql/query.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index 9005a1a83..ac5072c76 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -173,3 +173,13 @@ class UpdateQuery_pgsql extends UpdateQuery { return $stmt->rowCount(); } } + +class SelectQuery_pgsql extends SelectQuery { + + public function orderRandom() { + $alias = $this->addExpression('RANDOM()', 'random_field'); + $this->orderBy($alias); + return $this; + } + +} |