Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 1.2.0, 1.2.1, 1.2.2
-
Fix Version/s: 1.2.3
-
Component/s: None
-
Labels:None
-
Environment:symfony - sfDoctrinePlugin, MySQL
Description
Hi,
When you have defined orderBy table option in yml file, like:
orderBy[ field1 ASC, field2 DESC ]
and models build by doctrine:build --model
Doctrine_Table class reports warnings, when executing select query i.e.:
Warning: array_map() [function.array-map]: Argument #2 should be an array in ....\doctrine\Doctrine\Table.php on line 1134
that's causes no order at all in sql query
quick solution for this problem is change file \doctrine\Doctrine\Table.php, function processOrderBy() - around line 1134
from:
$e1 = explode(',', $orderBy);
to:
if( !is_array($orderBy)){
$e1 = explode(',', $orderBy);
}else{
$e1 = $orderBy;
}
hope it helps to someone
best,
Wojtek