How to handle customers with multiple addresses in CakePHP

Posted by Ryan on Stack Overflow See other posts from Stack Overflow or by Ryan
Published on 2010-05-12T00:09:25Z Indexed on 2010/05/12 0:14 UTC
Read the original article Hit count: 250

Filed under:
|
|

I'm putting together a system to track customer orders. Each order will have three addresses; a Main contact address, a billing address and a shipping address. I do not want to have columns in my orders table for the three addresses, I'd like to reference them from a separate table and have some way to enumerate the entry so I can determine if the addressing is main, shipping or billing. Does it make sense to create a column in the address table for AddressType and enumerate that or create another table - AddressTypes - that defines the address enumeration and link to that table?

I have found other questions that touch on this topic and that is where I've taken my model. The problem I'm having is taking that into the cakePHP convention. I've been struggling to internalize the direction OneToMany relationships are formed - the way the documentation states feels backwards to me.

Any help would be appreciated,

Thanks!

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about mysql