From 2b06f512d2aa6cf088eb1d8d8055d3614c954d3c Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 7 Feb 2007 14:22:45 +0000 Subject: [PATCH] added support for random() --- lib/Doctrine/Expression/Mysql.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Doctrine/Expression/Mysql.php b/lib/Doctrine/Expression/Mysql.php index 3118c91d2..985a37d0c 100644 --- a/lib/Doctrine/Expression/Mysql.php +++ b/lib/Doctrine/Expression/Mysql.php @@ -41,6 +41,15 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression { return 'RLIKE'; } + /** + * return string to call a function to get random value inside an SQL statement + * + * @return string to generate float between 0 and 1 + */ + public function random() + { + return 'RAND()'; + } /** * build a pattern matching string *