Recursive in CakePHP
Today we are going to learn about Recursive in CakePHP . Using this recursive property, Cake will know about the depth of the result that needs to be generated when find() and read() methods are used.It is needed to set the depth of the retrieval of records associated with a model data so we can limit how much data is fetched from the query in case of multi levels of associations between your models. Lets say for example we have Author module which has many Books.Now you have such case in which you want to retrive the data of the authors plus their books too.So in this case how Recursive play its role? We have Model file for Author having the following code. <?php class Author extends AppModel { var $name = 'Author'; } ?> and Model for the Book, <?php class Book extends AppModel { var $name = 'Book'; } ?> Now write the index function in AuthorsController.php file public function index() { $authors = $thi...