Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.14, 1.1.6, 1.2.0-BETA3
    • Component/s: Import/Export
    • Labels:
      None
    • Environment:
      linux / windows

      Description

      after upgrade of doctrine version ( as a part of symfony upgrade) now creates new "camelcase" names insted of the existing classes (e.g. "Tbl_My_Table" replaced to "TblMyTable"), the problematic function is "importSchema" in the attched "Import.php" file. i have added remarks to the lines that creates the the error.

      1. Import.php
        13 kB
        Oded Bahar
      2. Import.php
        13 kB
        Oded Bahar

        Activity

        Hide
        Oded Bahar added a comment -

        attached a resolution for this bug. please check and approve if possiable

        Show
        Oded Bahar added a comment - attached a resolution for this bug. please check and approve if possiable
        Hide
        Jonathan H. Wage added a comment -

        This is not a bug, this is how the behavior should be. The className is set to the classified version of the table name. The table is set to what it is in the database. So a table named "table_name" would become a class named "TableName"

        Show
        Jonathan H. Wage added a comment - This is not a bug, this is how the behavior should be. The className is set to the classified version of the table name. The table is set to what it is in the database. So a table named "table_name" would become a class named "TableName"
        Hide
        Oded Bahar added a comment -

        please check previous versions of this file, where classes named "ENT_Table_Names" could be created, if you would change the classes names then you would break the consistency for earlier versions where this was possible,

        Show
        Oded Bahar added a comment - please check previous versions of this file, where classes named "ENT_Table_Names" could be created, if you would change the classes names then you would break the consistency for earlier versions where this was possible,
        Hide
        Jonathan H. Wage added a comment -

        What version of Symfony are you using? This behavior has been this way for quite a while. "table_name" becomes a class named "TableName" with the tableName set to "table_name".

        Show
        Jonathan H. Wage added a comment - What version of Symfony are you using? This behavior has been this way for quite a while. "table_name" becomes a class named "TableName" with the tableName set to "table_name".
        Hide
        Oded Bahar added a comment -

        the symfony version was 1.2.2 and we have upgraded to 1.2.9
        doctrine current version 1.0.12, upgraded from 1.0.6

        The database table name we are using is "ENT_Table_Name".

        In the original ImportSchema function, line 385:
        $classTable = Doctrine_Inflector::tableize($table);
        line 396-397
        $relClassTable = Doctrine_Inflector::tableize($table);
        $class = Doctrine_Inflector::classify($relClassTable);

        tablize would create e_n_t_table_name
        and classifiy would rename it to ENT_Table_Name

        in the current version importschema line 384:
        $definition['tableName'] = $table;
        $definition['className'] = Doctrine_Inflector::classify($table);

        so the name is replaced to ENTTableName which breaks consistency. i.e. we had ENT_Table_Name (ver 1.06) and now we have ENTTableName (version 1.0.12)

        Show
        Oded Bahar added a comment - the symfony version was 1.2.2 and we have upgraded to 1.2.9 doctrine current version 1.0.12, upgraded from 1.0.6 The database table name we are using is "ENT_Table_Name". In the original ImportSchema function, line 385: $classTable = Doctrine_Inflector::tableize($table); line 396-397 $relClassTable = Doctrine_Inflector::tableize($table); $class = Doctrine_Inflector::classify($relClassTable); tablize would create e_n_t_ table _name and classifiy would rename it to ENT_Table_Name in the current version importschema line 384: $definition ['tableName'] = $table; $definition ['className'] = Doctrine_Inflector::classify($table); so the name is replaced to ENTTableName which breaks consistency. i.e. we had ENT_Table_Name (ver 1.06) and now we have ENTTableName (version 1.0.12)
        Hide
        Jonathan H. Wage added a comment -

        Ok I see what the issue was. I removed the line of code that first tableizes it.

        Show
        Jonathan H. Wage added a comment - Ok I see what the issue was. I removed the line of code that first tableizes it.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Oded Bahar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: