If you want to create a single categories table and method, you can
use the setScope method of the tree behaviour to simulate multiple
independent trees.
so you might have:
categories
--------------------
id
name
category_type_id
parent_id
lft
rght
category_types
---------------------
id
name
And then in your code before reading and modifying the tree you would
do:
$this->Category->setScope(array('category_type_id' => 1));
You could even use separate models for each category type if you've
got custom code:
class ProductCategory extends Category {
}
Cheers,
Adam
On Mar 8, 3:46 am, Josoroma <[EMAIL PROTECTED]> wrote:
> I have the model, controller and views necessary to manage a nested
> set model using the tree behavior:http://bin.cakephp.org/view/1041355028
> My table is categories.
>
> Now, i need to manage categories of products, services and events.
> Because of that i created the tables:
> productcategories
> servicecategories
> eventcategories
>
> How do i re-use the same category model but only changing the table?
> Maybe selecting a categories table from select input in a view form?
>
> Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---