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…

One Response to “Order By On findManyToManyRowset method for Zend Framework”

  1. zsolt Says:

    Thank you for your article, it help me. I am beginner in ZF, but very agile, because I have to refactor a webportal into Zend Framework. :)

    By,

    Zsolt
    (from Hungary)

Leave a Reply