[Solar-talk] _hasOne Help

Kilbride, James P. James.Kilbride at gd-ais.com
Wed Nov 14 12:21:54 CST 2007


Does that actually do it or does the auto-create, if it occurs, always
add id regardless? When I was looking through the model code some time
back(0.28.0 admittedly) it looked like model always added id to the
columns if it was already there.

James Kilbride 

-----Original Message-----
From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Rodrigo
Moraes
Sent: Wednesday, November 14, 2007 1:18 PM
To: solar-talk at lists.solarphp.com
Subject: Re: [Solar-talk] _hasOne Help

On Nov 14, 2007 4:12 PM, Kilbride, James P. wrote:
> This is why I don't really like solar's assumption that there is an ID

> column on all tables since I like to have the primary key Id called 
> even on it's native table by the id type rather than simply id. It's 
> purely a 'preference' thing but I tend to have my market tables, for 
> example, have Market_Id as the primary key and company has Company_Id,

> so the names have an easy to see equivalence relationship when they 
> end up foreign keyed in other tables.

oh, but this is just a convention. in your models, you can use any
primary key name you want overriding the property $_primary_col:

    $_primary_col = 'my_column_name';

-- rodrigo
_______________________________________________
Solar-talk mailing list
Solar-talk at lists.solarphp.com
http://mailman-mail3.webfaction.com/listinfo/solar-talk



More information about the Solar-talk mailing list