It certainly works!  One of my client's database was built before I 
took over.  It used to be spaghetti-code PHP that I have (mostly) 
converted to CakePHP.  This database has as primary keys user_id, 
j_id, prodid, etc.  A foreign key to user_id may be j_owner and to 
prodid is rfc_prodid.

You have to specify the primary key's name and in the associations 
specify foreign key's name.  It is more work but does work nicely.  
One caveat is how the magic functions work.  Just remember how the 
conventions work and you'll do okay.  To find the user_id use $this-
>User->findByUserId(1) because the capital I means there is a _.  To 
find by prodid use $this->Product->findByProdid(1).  Notice no capital 
I prodid as there is no _.

HTH,
David Lloyd

On Jan 26, 10:43 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 1/26/07, Erich C. Beyrent <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, for instance, tables that have a primary key of ID instead of id,
> > or perhaps even UserID.  It's the modeling of the database that concerns
> > me - what I need to do to get the models to work.Others can confirm or deny 
> > this for me, but I'm pretty sure you can
> override some of the default values that the Cake models use for
> primary key.  I know you can do it in Rails (I have done so with
> legacy tables).
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> rallyhat.com - digitial photo scavenger hunt
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to