Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the meaning of recursive in cakephp?

Tags:

cakephp

well, i have this line of code in the tutorial i am following. However, it did not provided me the clear explanation regarding recursive. I am a newbie in cakephp and searched about this "recursive". I hope somebody could provide me a layman's explanation of this code:

$this->Author->recursive = 1;

Thank you

like image 464
Charmie Avatar asked Apr 30 '12 09:04

Charmie


People also ask

What is recursion in programming?

In computer science, recursion is a programming technique using function or algorithm that calls itself one or more times until a specified condition is met at which time the rest of each repetition is processed from the last one called to the first.


1 Answers

First result on Google is a clear explanation from the reference of Cakephp itself: http://book.cakephp.org/2.0/en/models/model-attributes.html#recursive

It is needed to set the depth of the retrieval of records associated with a model data so that you can limit how much data is fetched from the query when there are many levels of associations between your models.

like image 94
Jack Avatar answered Sep 22 '22 05:09

Jack