Re: How to get all children of a parent if parent_id field is null
May we assume that you are employing the Tree Behavior in this Section model?
If so, the parent_id would only be null for the top most parent... correct? Generally, when you use a tree or this kind, you must look at it like a collection? So the top most element describes the collection. So, you would always assume is had children and that is always has a parent... then test accordingly.
If not, then you have some more obvious errors in the code you provided... but before we get in to that... let's answer the Tree question.
Let me know.
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home