Author: ornicar2
Date: 2010-02-03 15:03:20 +0100 (Wed, 03 Feb 2010)
New Revision: 27494
Modified:
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
Log:
[Diem]
- fixed record_loremizer enum, integer and float value generation
Modified:
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
===================================================================
---
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
2010-02-03 13:56:04 UTC (rev 27493)
+++
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
2010-02-03 14:03:20 UTC (rev 27494)
@@ -156,14 +156,14 @@
$val = date("Y-m-d", mt_rand(strtotime('-10 year') , time()));
break;
case 'enum':
- $val = $column['values'][array_mt_rand($column['values'])];
+ $val = $column['values'][array_rand($column['values'])];
break;
case 'integer':
- $val = mt_rand(0,100000);
+ $val = mt_rand(0, pow(10, $column['length']) - 1);
break;
case 'float':
case 'decimal':
- $val = mt_rand(0,1000000)/100;
+ $val = mt_rand(0, pow(10, $column['length']) - 1)/pow(10,
$column['scale']);
break;
default:
throw new dmException(sprintf('Diem can not generate random content
for %s column', $columnName));
@@ -239,4 +239,4 @@
return $id;
}
-}
\ No newline at end of file
+}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.