[Dbix-class] Re: doing a search
Bill Moseley
moseley at hank.org
Sat Jan 20 22:52:16 GMT 2007
On Sat, Jan 20, 2007 at 10:37:33PM +0100, A. Pagaltzis wrote:
> Am I the only one who uses ${desc}_${othertable} as the name for
> FK columns? Eg. a table with weblog posts/comments in a system I
> design might look like this:
>
> CREATE TABLE entry (
> id INTEGER PRIMARY KEY,
> author_user INTEGER REFERENCES user(id),
> body TEXT
> );
How is that helpful to you? Does that let you know it's a column you
can call other methods on?
$entry->author -- not sure if can call other methods
$entry->author_user -- clear that can call "user" class methods
Or some other reason?
I like brief names. I'm working with a MySQL database now called
"webcast" where tables are prefixed by the database name, and then
columns are prefixed by their table name. Unfortunately, there's a
table "webcast" (hence table "webcastWebcast") so a column looks like:
webcast.webcastWebcast.webcastTimestamp
Not that I know exactly *what* that time represents. That database is
part of a PHP application where it seems that CamelCase is common.
--
Bill Moseley
moseley at hank.org
More information about the Dbix-class
mailing list