Hi,

This may be a very basic question, but I've been struggling with a
design problem in hasAndBelongsToMany relationship.

I have a "Seminar" model that represents seminar information, and each
of the seminar can have many payment methods like in Cash, CreditCard,
Bank Transfer, etc.

I have defined the "PaymentMethod" definitions in bootstrap.php as
follows:

Configure::write('PaymentMethod.Cash', 1);
Configure::write('PaymentMethod.CreditCard', 2);
Configure::write('PaymentMethod.BankTransfer', 3);
...

As the seminars can have many payment methods, and each payment method
can have many seminars that uses it, the relationship between
"Seminar" and "PaymentMethod" models is "Has And Belongs To Many
(HABTM)".

If I want to use the CakePHP HABTM relationship functionality, it
seems that I need to have a database table for the PaymentMethod
constants as well as the Seminars and the join table
seminars_payment_methods.

In this case, should I create a table for the "PaymentMethod" and
insert those constant data, instead of defining in the
Configure::write() method?

I don't feel it's a good design to create a table just for the
constants that may never be modified in the app. There could be a lof
of these cases, so I might have to have SO MANY of the tables that
hols constants...

What is the best practice in this case?

Thanks for your help in advance.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to