Wednesday, January 19, 2022

[FIXED] what is the meaning of recursive in cakephp?

Issue

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


Solution

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.



Answered By - Jack

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.