You'd put those in the Firm model (as each Firm hasOne manager and one Contact).
On 18 Sep 2012, at 03:27, Jeff Prater <[email protected]> wrote: > Thanks for the quick reply! > > Where would I be adding this? To the User model or to the Firms model? Or > both? > > On Sunday, September 16, 2012 4:30:37 AM UTC-4, Jeremy Burns wrote: > 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. >> >> > > > -- > Like Us on FacekBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > > -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
