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.
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.