Order By On findManyToManyRowset method for Zend Framework

Select statements (via Zend_Db_Table_Select) can now be passed into the findManyToManyRowset method of Zend_Db_Table_Row_Abstract. In ZF 1.0, I couldn’t order my result sets coming back from MySQL, which was a pain. Now, I can use the following code, where $m is a Row object:


<?php
$select 
$m->select()->order(array(’startDate DESC’,‘endDate ASC’));
$tripreportRowset $m->findManyToManyRowset(‘Tripreport’‘TripreportMountain’,NULL,NULL,$select);

?>


If you don’t need to order by multiple columns, then don’t pass an array…

Leave a Reply