Hey folks,

I'm desperately trying to get a hang of how to establish the
following:
1) Let's assume I have the following models: Post, User, Category
2) My category model contains a parent_id field, allowing for an
endlessly deep tree structure of categories
3) Every Post belongs to a single category

Now I'm trying to tell cakephp to make a query resulting in sth like
the following:

Array
(
    [0] => Array
        (
            [Post] => Array
                (
                    [id] => 1
                    [user_id] => 1
                    [category_id] => 59
                    [...]
                )

            [User] => Array
                (
                    [id] => 1
                    [...]
                )

            [Category] => Array
                (
                    // Here i need a Tree Structure starting at the
posts directly associated category_id, going up until the category
with parent_id 0
                )
        )



The solution might be pretty easy, i don't really know. I read the
(f*) manual a lot, but i cannot figure it out. If someone could give
me some hints i would be more than thankful!

Bye.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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