this:
1. Shop -> hasMany -> Categories
2. Categories are TreeBehavior
3. For every Shop I put new root Category, so it look like:
- Root Category for Shop #1
--- Category 1
--- Category 2
- Root Category for Shop #2
--- Category 1
--- Category 2
So all Categories are in one tree and for every shop have new root
Category.
Now I need to know the root Category for Shop. Is this better to code:
Category::getRoot($shop_id)
or
Shop::getRootCategory($id)
This is specific case, but of course the question can be for common
situation (just treat Shop as X, and Category as Y).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment