Getting started - Setting table definition - Field(Column) naming.php 1.06 KB
Newer Older
1 2
One problem with database compatibility is that many databases differ in their behaviour of how the result set of a
query is returned. MySql leaves the field names unchanged, which means if you issue a query of the form
zYne's avatar
zYne committed
3 4 5 6
"SELECT myField FROM ..." then the result set will contain the field 'myField'.
<br />
<br />
Unfortunately, this is just the way MySql and some other databases do it. Postgres for example returns all field names in lowercase
7
whilst Oracle returns all field names in uppercase. "So what? In what way does this influence me when using Doctrine?",
zYne's avatar
zYne committed
8 9
you may ask. Fortunately, you don't have to bother about that issue at all. <br />
<br />Doctrine takes care of this problem
10 11 12 13
transparently. That means if you define a derived Record class and define a field called 'myField' you will always
access it through $record->myField (or $record['myField'], whatever you prefer) no matter whether you're using MySql
or Postgres or Oracle ect.<br />
<br />
zYne's avatar
zYne committed
14
In short: You can name your fields however you want, using under_scores, camelCase or whatever you prefer.