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.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

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