strauberry
strauberry

Reputation: 4199

Order the result of findDependentRowset does not work

I'm using the findDependentRowset() of the Zend-Framework. Here, I want to define some selection settings like ORDER or LIMIT.

The examplecode I've found doesn't work at all for me :-(

$table = new MyTable(); // extends Zend_Db_Table
$row = $table->fetchAll()->current(); 
$rowset = $row->findDependentRowset(
   'table',
   $table->select()->order('von ASC')->limit(1)
);

First thing is, that the select() method is not defined here. I have to use getAdapter() to be able to use this method. Next, I get a warning:

No reference rule "SELECT ORDER BY `von` ASC LIMIT 1"

How can I fix this?

Thank you very much!!

Upvotes: 0

Views: 575

Answers (1)

David Snabel-Caunt
David Snabel-Caunt

Reputation: 58361

Check the API docs for Zend_Db_Table_Row_Abstract - the Zend_Db_Table_Select should be passed in as the third parameter, not the second.

Upvotes: 2

Related Questions