Quote from: OpenGeek at Jan 30, 2006, 01:57 PM
I think this would require an optional parameter in the methods, otherwise, how would I find tables without the prefix? It seems just as easy to me to say $modx->getFullTableName(’site_content’) as the table param in the method call.
I agree that having to give an autoPrefix parameter in each method call isn’t much better than using getFullTableName but that’s why I thougt it would be good as a object property. I’m thinking that about 99% of the time you’re gotta want to have a prefix with your table names so I’m much more concerned with making it easy to include prefixes than to exclude them. Buf it you did want to exclude them you should be able to just set the property
$db = new DBAPI();
$db->autoPrefix = false;
$db->select('*','my_table');
The table prefix is a constant value that virtually never changes and it seems crazy that I have to deal with it in almost every bit of code I write. It’s not a huge inconvenience of course, but if we could make it one less hoop to jump through it would be nice.
Honestly, I don’t like the getFullTableName method much because you have to call it for every table you use. I’d rater set a $prefix variable and be able to reuse it.
Obviously this is not a huge deal. I just thought it would save a bit of time and hassle and I’m happy to keep things the way they are if there are any doubts about this.