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 » Installation and setup » Propel - using a prefix for the tables but not for the classes
Propel - using a prefix for the tables but not for the classes [message #76205] Fri, 03 April 2009 11:32 Go to next message
danielebean  is currently offline danielebean
Messages: 25
Registered: April 2009
Junior Member
Hi all.

I'd like to use a prefix for my database tables(for example, core_) but I'd like the prefix not to appear in the class names.

Let's say, I have these tables:
core_author
core_book
But I'd like Propel to autogenerate these classes:
Author
Book

If I use
core_author
core_book
in my schema.yml
I get these classes:
CoreAuthor
CoreBook

I have searched on the Propel Documentation and on Google but I can't find the solution for this problem of mine.

Thanks,
Daniele

[Updated on: Fri, 03 April 2009 13:04]

Re: Propel - using a prefix for the tables but not for the classes [message #76207 is a reply to message #76205 ] Fri, 03 April 2009 12:50 Go to previous messageGo to next message
danielebean  is currently offline danielebean
Messages: 25
Registered: April 2009
Junior Member
I have found a solution but I think there must be something better.

In my schema.yml file I'm using:
author
book
[but my tables are still core_author and core_book]

and I edit the classes:
BaseAuthorPeer
BaseBookPeer
setting the constant TABLE_NAME to 'core_author' and all the other constants defining the fields (ID, TITLE....)

but there must be something Symfony can do automatically without me editing the Base Classes...

Re: Propel - using a prefix for the tables but not for the classes [message #76238 is a reply to message #76205 ] Fri, 03 April 2009 21:00 Go to previous message
danielebean  is currently offline danielebean
Messages: 25
Registered: April 2009
Junior Member
Guys, I have found the trick!

http://www.danieleocchipinti.com/blog-linux-php-lamp-web/web -development/symfony/symfony-propel-using-a-prefix-for-the-t ables-but-not-for-the-classes

Enjoy it!
Previous Topic:Admin generator - no _edit_header.php file
Next Topic:symfony installation
Goto Forum:
  

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