Hi,
I have a tricky Associationsproblem:
The Data is retrieved by an XML Request and Stored locally. For that i
wrote a console shell script which works fine at this time.
Following DB Structure:
CREATE TABLE `hotel_types` (
`id` int(11) NOT NULL auto_increment,
`hoteltype_id` int(255) NOT NULL default '0',
`languagecode` varchar(10) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
CREATE TABLE `hotels` (
`id` bigint(20) NOT NULL auto_increment,
`address` varchar(255) NOT NULL default '',
`hotel_id` bigint(20) NOT NULL default '0',
`hoteltype_id` int(255) NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`url` varchar(255) NOT NULL default '',
`zip` varchar(255) NOT NULL default '',
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
Every Hotel hasOne HotelType: Hotel.hoteltype_id =
HotelType.hoteltype_id
I don't know how to tell Cake the different Naming Convention.
If I change in HotelType Model
var $primaryKey = "hoteltype_id";
my Update Scripts won't work (because the primaryKey for Updates is
still 'id' ).
I see two possible Methods:
1) There is way to tell cake the different associations.
2) I need to use different Models for my UpdateScript.
What Do you think?
Regards,
Alexander
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---