php - Is it fine to instantiate models for tables for which model files are not created -
there more 300 tables in our cakephp application. used create model file each of table later started use objects of existing thin models, operating on tables not used or not important implementation of business logic point of view.
i work this.
$resumes = new profile('','resumes','connectionname'); or $resumes = new profile(20,'resumes','connectionname'); $resumedata = $resume->read();
this works me , rid of creating files remain without code, curious know if break convention or design patterns.
you don't need create model files
you can instanciate models, whether file exists or not, using class registry:
$inst = classregistry::init('resume');
this return instance of appmodel
- using table resumes
.
don't use new modelname
it's not normal write new modelname
- use of existing means of creating models instead (classregistry::init, $uses, associations).
Comments
Post a Comment