generateTreeList starting from an id

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

generateTreeList starting from an id

ernesto-3-3
Hi all.

i'm using TreeBehavior in one of my Models and everything is working ok.

just one question:
generateTreeList returns a list containing ALL the entries in the table.

i want the treeList just for the category with id = 20 and his childrens

how can i do?

--
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
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|

Re: generateTreeList starting from an id

ernesto-3-3
i forgot to say i've already tried the "conditions" argument but the function will return just the first layer of results

Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
Hi all.

i'm using TreeBehavior in one of my Models and everything is working ok.

just one question:
generateTreeList returns a list containing ALL the entries in the table.

i want the treeList just for the category with id = 20 and his childrens

how can i do?

Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
Hi all.

i'm using TreeBehavior in one of my Models and everything is working ok.

just one question:
generateTreeList returns a list containing ALL the entries in the table.

i want the treeList just for the category with id = 20 and his childrens

how can i do?

--
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
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|

Re: generateTreeList starting from an id

gimmebucks
What i always do is get the node lft and rght value.
then set conditions array('Model.lft >' => $node['lft'],'Model.rght <'
=> $node['rght'])
to include the node, substitute > with >= and < with <=

On Mar 16, 12:06 am, Ernesto <[hidden email]> wrote:

> i forgot to say i've already tried the "conditions" argument but the
> function will return just the first layer of results
>
> Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
>
>
>
> > Hi all.
>
> > i'm using TreeBehavior in one of my Models and everything is working ok.
>
> > just one question:
> > generateTreeList returns a list containing ALL the entries in the table.
>
> > i want the treeList just for the category with id = 20 and his childrens
>
> > how can i do?
>
> Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
>
>
>
>
>
>
>
>
>
> > Hi all.
>
> > i'm using TreeBehavior in one of my Models and everything is working ok.
>
> > just one question:
> > generateTreeList returns a list containing ALL the entries in the table.
>
> > i want the treeList just for the category with id = 20 and his childrens
>
> > how can i do?

--
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
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|

Re: generateTreeList starting from an id

Lê Minh Thành
work for me


Vào 20:45:23 UTC+7 Thứ Sáu, ngày 16 tháng 3 năm 2012, gimmebucks đã viết:
What i always do is get the node lft and rght value.
then set conditions array('Model.lft >' => $node['lft'],'Model.rght <'
=> $node['rght'])
to include the node, substitute > with >= and < with <=

On Mar 16, 12:06 am, Ernesto <[hidden email]> wrote:

> i forgot to say i've already tried the "conditions" argument but the
> function will return just the first layer of results
>
> Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
>
>
>
> > Hi all.
>
> > i'm using TreeBehavior in one of my Models and everything is working ok.
>
> > just one question:
> > generateTreeList returns a list containing ALL the entries in the table.
>
> > i want the treeList just for the category with id = 20 and his childrens
>
> > how can i do?
>
> Il giorno giovedì 15 marzo 2012 16:49:30 UTC+1, Ernesto ha scritto:
>
>
>
>
>
>
>
>
>
> > Hi all.
>
> > i'm using TreeBehavior in one of my Models and everything is working ok.
>
> > just one question:
> > generateTreeList returns a list containing ALL the entries in the table.
>
> > i want the treeList just for the category with id = 20 and his childrens
>
> > how can i do?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.