is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 13 years ago

Last modified 9 years ago

#661 confirmed enhancement

jDao should be able to "order by rand()"

Reported by: greut Owned by:
Priority: normal Milestone:
Component: jelix:dao Version: 1.0.5
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:


I'd like to be able to do this:

// ...

See there you go:

diff -r 7926988cdd03 www/lib/jelix/dao/jDaoFactoryBase.class.php
--- a/www/lib/jelix/dao/jDaoFactoryBase.class.php       Tue Aug 12 18:51:17 2008 +0200
+++ b/www/lib/jelix/dao/jDaoFactoryBase.class.php       Wed Aug 13 16:39:00 2008 +0200
@@ -332,6 +332,8 @@
         foreach ($daocond->order as $name => $way){
             if (isset($props[$name])){
                 $order[] = $name.' '.$way;
+            } else if(strtoupper($name) === "RAND()") {
+                $order[] = $name;


-- Yoan

Change History (4)

comment:1 Changed 13 years ago by black_jack

comment:2 Changed 13 years ago by laurentj

  • Component changed from jelix to jelix:dao

comment:3 Changed 10 years ago by laurentj

  • Status changed from new to confirmed
Note: See TracTickets for help on using tickets.