Question about a model.  I'm creating a table like below where
category_id is a foreign key to the categories table (basically the
parent id because I'm building a tree in the database in one table).
I was wondering A) is this a good approach for building categories
that can be applied to multiple sets of content and B) what would the
model code look like (i.e. would I use $hasMany
$hasManyAndBelongsToMany)?

Thanks for any help!

CREATE TABLE `categories` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `description` text,
  `link` varchar(255) default NULL,
  `level` int(11) default NULL,
  `order` int(11) NOT NULL,
  `category_id` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to