many-to-many order

View: New views
2 Messages — Rating Filter:   Alert me  

many-to-many order

by Tim Sawyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do I add an order to this query?


         require_once "SlocsTable.php";
         $slocsTable= new SlocsTable();
         $slocsRowset = $slocsTable->find($id);
         $sloc = $slocsRowset->current();

         #require_once "SansTable.php";
         #$sansTable = new SansTable();
         #$select = $sansTable->select()->order('san_name');

         $sansRowset = $sloc->findManyToManyRowset('SansTable',  
'SlocsSansTable', 'Sloc');


My commented attempts did not work. TIA, very much.
--
Tim
:wq


Re: many-to-many order

by Jack Sleight :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This should do it:

$sansRowset = $sloc->findManyToManyRowset('SansTable', 'SlocsSansTable',
'Sloc', null, $slocTable->select()->order('san_name'));
--
Jack
LightInTheBox - Buy quality products at wholesale price