This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » [resolved] Table with a column named "class"
[resolved] Table with a column named "class" [message #25445] Wed, 11 April 2007 13:52 Go to next message
remopini  is currently offline 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 Go to previous messageGo to next message
halfer  is currently offline 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 Go to previous message
remopini  is currently offline remopini
Messages: 11
Registered: March 2007
Junior Member
Yup... this worked...
Previous Topic:can we compare two select box values using sfCompareValidator
Next Topic:propel-dump-data/propel-load-data bug?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software