That would do it. Then you need to set up your model associations.

public $hasOne = array(
        'Manager' => array(
                'className'    => 'User',
                'foreignKey'   => 'manager_user_id'
        ),
        'Contact' => array(
                'className'    => 'User',
                'foreignKey'   => 'contact_user_id'
        )
);

On 15 Sep 2012, at 21:14, Jeff Prater <[email protected]> wrote:

> I'm getting started with v2.2. I'm trying to layout my database, but I'm 
> unsure how to handle the naming conventions. I have a main table, firms, 
> which stores all the companies/firms For each firm, I want to designate a 
> managing user and contact user from the users table. I need to associate a 
> specific user account from the users table. Is this the correct way to name 
> these? After reading the conventions section in the book, I'm still a little 
> confused as how to name these columns. Thanks!
> 
> firms
> ---------
> id
> firm_name
> manager_user_id  **
> contact_user_id  **
> 
> users
> ---------
> id
> user_name
> email_address
> etc.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to