Object relational mapping - Table and class naming.php 994 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2
Doctrine automatically creates table names from the record class names. For this reason, it is recommended to name your record classes using the following rules:

3 4 5 6
    * Use CamelCase naming
    * Underscores are allowed
    * The first letter must be capitalized
    * The class name cannot be one of the following (these keywords are reserved in DQL API): 
hansbrix's avatar
hansbrix committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

        SELECT, FROM, WHERE, UPDATE, DELETE, JOIN, OUTER, INNER, LEFT, GROUP, ORDER, BY, HAVING,

        FETCH, DISTINCT, OBJECT, NULL, TRUE, FALSE, 

        NOT, AND, OR, BETWEEN, LIKE, IN,

        AS, UNKNOWN, EMPTY, MEMBER, OF, IS, ASC, DESC, 

        AVG, MAX, MIN, SUM, COUNT,

        MOD, UPPER, LOWER, TRIM, POSITION, 

        CHARACTER_LENGTH, CHAR_LENGTH, BIT_LENGTH, CURRENT_TIME, CURRENT_DATE, 

        CURRENT_TIMESTAMP, NEW, EXISTS, ALL, ANY, SOME.
23

hansbrix's avatar
hansbrix committed
24 25 26 27 28

Example. My_PerfectClass


If you need to use a different naming schema, you can override this using the setTableName() method in the setTableDefinition() method.
29