Hi, I got a little problem how to get only specific branch of categories in
my threaded array.

Imagine self-joined table with categories  joined by parent ID.

e.g. e-shop sections like Bikes, Electronics, Vines, ... etc..
Each of them have its own categories, who have its own categories, etc...

I would like to use find('threaded'), but just PER one section (e.g. vines)
... Now I get the WHOLE tree! Thats I dont want, I would prefer say in
conditions  Category.name = 'vines' and receive already array just with
wines.. but that seems not working, with conditions I dont get childers!!
becasue they dont match that conditions (of course :))

Any Ideas? Is it better to filter the result or it is possible specify that
when querying database??

I am posting an example array I get now (just with find('threaded')): 

Array
(
    [0] => Array
        (
            [Section] => Array
                (
                    [id] => 1
                    [parent_id] => 
                    [name] => Vine
                )

            [ParentSection] => Array
                (
                    [id] => 
                    [parent_id] => 
                    [name] => 
                )

            [children] => Array
                (
                    [0] => Array
                        (
                            [Section] => Array
                                (
                                    [id] => 4
                                    [parent_id] => 1
                                    [name] => Red
                                )
                       )
                )
    )

[1] => Array
        (
            [Section] => Array
                (
                    [id] => 1
                    [parent_id] => 
                    [name] => Electronic
                )

            [ParentSection] => Array
                (
                    [id] => 
                    [parent_id] => 
                    [name] => 
                )

            [children] => Array
                (
                    [0] => Array
                        (
                            [Section] => Array
                                (
                                    [id] => 4
                                    [parent_id] => 1
                                    [name] => Computer
                                )
                       )
                )
    )
)


Thanks a lot!
Tomas


-- 
View this message in context: 
http://www.nabble.com/Querying---filtering-an-array-done-by-find%28%27threaded%27%29-tp22782400p22782400.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to