etcgroup / text-prizm

3 stars 0 forks source link

Store table names in a shared model or library #73

Open michaelbrooks opened 11 years ago

michaelbrooks commented 11 years ago

Table names sometimes change (though hopefully not often) and they are scattered throughout our model files.

Create properties in a base model or in a library that all models can use to look up the table names.

If we put them in a base model, then all of the models will have access to them. If we put them in a library, the models will need to load the library, but it will only be instantiated once and can be used from outside models. I prefer the library but there could be other reasons the model approach is better.

In either case, the library or model should load a config file containing the table names on initialization to set all of the variables. It shouldn't store them in PHP.