| [resolved] Table with a column named "class" [message #25445] |
Wed, 11 April 2007 13:52  |
remopini Messages: 11 Registered: March 2007 |
Junior Member |
|
|
Hi all...
I have a (foreign) database table that I want to use within my Symfony app...
Here's the (shortened) XML of the table (created from the DB):
| Quote: |
<?xml version="1.0" encoding="utf-8"?>
<database name="raid" defaultIdMethod="native" noxsd="true" package="lib.model">
<table name="chars" phpName="raChars">
<column name="char_id" type="INTEGER" required="true" autoIncrement="true" primaryKey="true" />
<column name="name" type="VARCHAR" size="255" required="true" default="" />
<column name="class" type="VARCHAR" size="255" required="true" default="" />
</table>
</database>
|
Of course, when I run propel-build-schema, it generates broken PHP because "CLASS" is a reserved term. Since I cannot change the name of the column as it is used by another app, is there a way to "fix" the generation process to actually generate valid PHP code no matter what the name of the column is?
Regards
Remo
[Updated on: Fri, 13 April 2007 10:24]
|
|
|
| Re: Table with a column named "class" [message #25460 is a reply to message #25445 ] |
Wed, 11 April 2007 15:16   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Can you do:
<column name="class" phpName="myClass" type="VARCHAR" size="255" required="true" default="" />
Remember Palestine
|
|
|
| Re: Table with a column named "class" [message #25617 is a reply to message #25460 ] |
Fri, 13 April 2007 10:24  |
remopini Messages: 11 Registered: March 2007 |
Junior Member |
|
|
|
Yup... this worked...
|
|
|