Fix cs
This commit is contained in:
@@ -496,7 +496,7 @@ try {
|
|||||||
|
|
||||||
echo "Creating orders\n";
|
echo "Creating orders\n";
|
||||||
|
|
||||||
for($i=0; $i < 50; ++$i) {
|
for ($i=0; $i < 50; ++$i) {
|
||||||
|
|
||||||
$placedOrder = new \Thelia\Model\Order();
|
$placedOrder = new \Thelia\Model\Order();
|
||||||
|
|
||||||
@@ -902,11 +902,12 @@ function getRandomObject(\Propel\Runtime\ActiveQuery\ModelCriteria $query)
|
|||||||
{
|
{
|
||||||
$max = $query->count();
|
$max = $query->count();
|
||||||
|
|
||||||
if($max === 0) {
|
if ($max === 0) {
|
||||||
throw new Exception("There is no entry in ". get_class($query));
|
throw new Exception("There is no entry in ". get_class($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
$first_id = $query->findOne()->getId();
|
$first_id = $query->findOne()->getId();
|
||||||
$obj = $query->findPk(mt_rand($first_id, $first_id+$max-1));
|
$obj = $query->findPk(mt_rand($first_id, $first_id+$max-1));
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user