February 29, 2012

Recursive data retrieval from database in Zend framework similar to CakePHP

Question by waseem

In CakePHP, we can provide recursive option while retrieving data from database, which automatically fetches the data from all the dependent tables.

We can also provide option for recursive e.g recursive=2, which fetches dependent tables of the dependent tables.

How can we achieve the same functionality in Zend framework?

Answer by Starx

If you have defined Table Relationship on your model before, you can use findDependentRowset() to retrieve records from multiple related table. For more details, see this.

But i am not sure of limiting the recursion.

...

Please fill the form - I will response as fast as I can!