I have some Models that are not associated each other, when I need to fetch some info among them, should I use ClassRegistry::init('ModelName')
? Is it a good practice?
The controller should pass information between "not-interconnected" models?
I have some Models that are not associated each other, when I need to fetch some info among them, should I use ClassRegistry::init('ModelName')
? Is it a good practice?
The controller should pass information between "not-interconnected" models?
Is it a good practice?
CR is fine if there is no other way to get it. In a controller and shell you can use the $uses
property to load additional models as well. Note that the first item in the list is going to be the primary $modelClass
property of your controller.
The controller should pass information between "not-interconnected" models?
No, technically it can but all data manipulation should happen in the models. So pass whatever data you have to deal with from your controller to a model method and process it there and return it in the case your controller needs it again for something.