Hello !

I'm in a dilemma.
I have the following tables:


CREATE TABLE `langs` (
  `lang_id` tinyint(3) auto_increment,
  `abrev` varchar(32),
  `name` varchar(32),
  PRIMARY KEY  (`lang_id`)
)

CREATE TABLE `seasons` (
  `season_id` smallint(5) auto_increment,
  `year` varchar(16),
  `begin_date` date,
  `end_date` date,
  PRIMARY KEY  (`season_id`)
)

CREATE TABLE `seasons_langs` (
  `season_id` smallint(5),
  `lang_id` tinyint(3),
  `info` text,
  PRIMARY KEY  (`season_id`,`lang_id`)
)

In the 'langs' table I'll ad different languages. So, when I add a
record in the seasons table, I'll add N records in the 'seasons_langs'
table (N depends on the number of the languages, i.e. the records in
the 'langs' table.
I am not sure wich model to choose for this schema in CakePHP. A
possible approach is to define

class Season {

var $hasMany = array('SeasonLang');
}

class SeasonLang {

var $belongsTo = array('Season');
}

The another approach is HABTM with the three tables.
What do you think ?

Best regards, Stoyan.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to