Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Consider adding this method into Doctrine_Table
public static function getRandom()
{
return
self::getInstance()->createQuery()
->select('*, RANDOM() as rand')
->limit(1)
->orderBy('rand')
->fetchOne();
}
It is portable and very useful.