Hi Xaviar, you should pass a null value to the 2º parameter like this:

$ingredientsForRecipe = $recipe->findDependentRowset('Ingredients', null, 
$select);
Leonel Quinteros


> Date: Mon, 25 Feb 2008 13:14:57 +0000
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: [fw-general] fetchDepenentRowset with order
> 
> Im having trouble understanding this example and applying it to my
> situation was wondering if anyone can help
> 
> I want to fetch a dependent rowset in a table and order the results by
> a specific field in that table.
> 
> The example in the docs says this :
> 
> $accountsTable      = new Accounts();
> $accountsRowset     = $accountsTable->find(1234);
> $user1234           = $accountsRowset->current();
> $select             = $accountsTable->select()->order('name ASC');
> 
> $bugsAssignedToUser = $user1234->findDependentRowset('Bugs',
> 'Engineer', $select)
> 
> However I do not have the 2nd table reference so I would be doing, for
> my example I have Recipe that has many Ingredients, so Im doing
> 
> $r      = new Recipe();
> $rRowset     = $r->find(1234);
> $recipe   = $rRowset->current();
> 
> $ingredientsForRecipe = $recipe->findDependentRowset('Ingredients')
> 
> Now I want to sort the $ingredientsForRecipe rowset in a certain order
> say by their id number, Ive tried
> 
> $select = $r->select()->order( 'id ASC' );
> $ingredientsForRecipe = $recipe->findDependentRowset('Ingredients', $select);
> 
> But thats not working, any help appreciated, might be a good idea to
> expand the examples a bit in this area?
> 
> Cheers
> - Xaviar

_________________________________________________________________
Descargá ya gratis y viví la experiencia Windows Live.
http://www.descubrewindowslive.com/latam/index.html

Reply via email to