Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated-classes are invalid when table columns contain spaces #1907

Open
adjenks opened this issue Oct 12, 2022 · 1 comment
Open

generated-classes are invalid when table columns contain spaces #1907

adjenks opened this issue Oct 12, 2022 · 1 comment

Comments

@adjenks
Copy link

adjenks commented Oct 12, 2022

I generated a schema from my existing db and then built the model.
In a file ending with "TableMap.php" there was a const defined like so:

    /**
     * the column name for the Street Name field
     */
    const COL_STREET NAME = 'myschema.mylocationtable.Street Name';

The gap between "COL_STREET" and "NAME" is invalid.

This column with a space was defined in many places in the file. Replacing "COL_STREET NAME" with "COL_STREET_NAME" in the file seemed to resolve it.

@DarkAxi0m
Copy link
Contributor

DarkAxi0m commented Oct 19, 2022

I'm pretty sure what you want to do is, in the generated schmea, set tableMapName value,

http://propelorm.org/documentation/reference/schema.html#column-element

<column name="[Long Name]" tableMapName="Longname" phpName="Longname" type="VARCHAR" size="400"/>

edit: Just re-Read you issue, I agree the generator should do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants