CakePHP: Using two tables for a single model

Posted by mwaterous on Stack Overflow See other posts from Stack Overflow or by mwaterous
Published on 2010-05-23T23:18:24Z Indexed on 2010/05/23 23:20 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

I'm just picking up development in CakePHP right now so forgive me if this seems obvious; it did to me when I first read about has, belongsTo, hasMany, etc.

The problem is I would like to associate two tables with a single model, and was wondering if there was a way to configure this so that when CakePHP did it's queries it automatically performed a join on the two tables.

I don't want to create a separate model for the second table as it is merely a meta information table - the master table will contain the primary information required, the meta table will be populated with secondary information that is not required and therefore may or may not be set for every row of the master table.

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about tables