Q: Best Practice: How to address database rows using IDEs autocompletiton i'm looking for an 'best practice approach' for addressing database rows. I'm using PHP.
I'm working on a settings framework. If a dev wants to know if a specific setting is set he can just call Settings::getSetting(1); and he will get the value from the users settings.
The 1 here is the ID of the corresponding database row. ID is the only key in the table and the only unique feature.
My problem is: a dev needs a value from a setting but he doesn't want to look the ID up in the DB. My absolut fav approach would be to use statics: Settings::getSetting(Settings::SETTING_FONT_SIZE);
Creating statics implies to care about a mapping and this could result in errors. (Someone is entering a new setting in DB and forgets to also add it to the mapping).
I could create dynamic constants using define() but this constants also need to be known (but it is more elegant than dealing with IDs).
Is there a way to address a specific row without caring about a mapping and with code completition inside an IDE?
If necessary, I can change the database table
thank you in advance!
EDIT:
The database table i'm talking about has two columns. The first is the ID (unique, primary, autoincrement) and the second is called 'value' and varchar.
EDIT2:
"forget this, it is not possible what your are looking for" is an acceptable answer :)
