-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.2] Inject the db into the MVC layer #37095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This looks wrong to me. The only place that should be database aware is the model. All controller and views database queries should be eventually moved into the model. not be made database aware |
Totally agree with @wilsonge |
I agree too, and the problem is that there are queries which do not actually fit into a model, for example against the extensions table. I mean I can move all of them to the model of the view, but would be nicer to have them just from the beginning on the right place. |
|
This looks better. I don't think that factory should be databaseaware. Just the model. But definitely better than what we had before. |
|
True, removed the interface. |
|
I have tested this item ✅ successfully on 67cdd83 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37095. |
|
Thank you everybody |
Summary of Changes
Injects the database instance into the model. So we don't have to rely on the global db anymore. Additionally it deprecates the use of the database in the model constructor and uses the aware interface and trait from the db package.
Testing Instructions
Actual result BEFORE applying this Pull Request
All works.
Expected result AFTER applying this Pull Request
All works.